3 ms·
Interesting. In my validator [1], I take an entirely different approach. Everything throws an exception... which is caught and rethrown at every level, which yo
by striking 12y ago
Interesting. In my validator [1], I take an entirely different approach. Everything throws an exception... which is caught and rethrown at every level, which you can then "interrogate."
I did it this way because if someone calls the validation function and wants the method to fail immediately if something is wrong, it will. No need to check, it just does. But if you'd like to try validating and see if something messes up, you can!
[1]: https://github.com/callmeStriking/affirm-json https://github.com/callmeStriking/affirm-json (see src/validator.js or, heck, just run lib/valitest.js)