ExodusMovement / schemasafe

A reasonably safe JSON Schema validator with draft-04/06/07/2019-09/2020-12 support.
https://npmjs.com/@exodus/schemasafe
MIT License
161 stars 12 forks source link

Harden present() check #42

Closed ChALkeR closed 4 years ago

ChALkeR commented 4 years ago
    Fix keyval check in present()

    It might be 0 in arrays.
    Fast-track top-level boolean false

    This allows to harden present() check.

Due to this check being slow (and done twice in some edge cases), I will introduce some exceptions there after this PR lands. This is why code is currently organized that way -- i.e. separate branches for keyname and keyval.