Closed ChALkeR closed 4 years ago
Due to https://github.com/mafintosh/is-my-json-valid/blob/b5f46cd3c04c78fa15212ebfe95054b98c447bfb/index.js#L234-L241
If type is not an object, missing is undefined, which is not strict equal to 0, and all follow-up checks (including ones intended for non-objects) are excluded.
missing
undefined
0
Testcase:
const tape = require('tape') const validator = require('is-my-json-valid') tape('test', (t) => { const validate = validator({ required: [], uniqueItems: true }) t.notOk(validate([1, 1]), 'required + uniqueItems') t.end() })
Due to https://github.com/mafintosh/is-my-json-valid/blob/b5f46cd3c04c78fa15212ebfe95054b98c447bfb/index.js#L234-L241
If type is not an object,
missing
isundefined
, which is not strict equal to0
, and all follow-up checks (including ones intended for non-objects) are excluded.Testcase: