sindresorhus/is

Inaccurate exception text

fredkilbourn opened this issue · 1 comments

Quick snippet:

const reason = 1000;
assert.any( [ is.undefined, is.nonEmptyString ], reason );

Error states something about truthy values and array type which are both completely unrelated to the assert types and variable type

TypeError: Expected value which is `predicate returns truthy for any value`, received value of type `Array`.
    at assertType (/home/vbot/srv/vbot/node_modules/@sindresorhus/is/dist/index.js:287:15)
    at Object.any (/home/vbot/srv/vbot/node_modules/@sindresorhus/is/dist/index.js:379:36)
    at file:///home/vbot/srv/vbot/test.js:40:8

Duplicate of #131