aboutsummaryrefslogtreecommitdiff
path: root/node_modules/minimalistic-assert/index.js
blob: 70b4ea5bba0a5daf39f735d6411f05333be0dff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
module.exports = assert;

function assert(val, msg) {
  if (!val)
    throw new Error(msg || 'Assertion failed');
}

assert.equal = function assertEqual(l, r, msg) {
  if (l != r)
    throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
};