standalone assertion libraries?

后端 未结 2 1871
暖寄归人
暖寄归人 2021-02-01 16:59

I was nearly through porting YUI assertion modules to standalone libraries when the thought popped into mind that I should have perhaps asked on StackOverflow if this was necess

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-01 18:03

    function assert(condition, message) {
        if (!condition) throw new Error(message)
    }
    

提交回复
热议问题