silfverorg / duns.js

Javascript schema validator
5 stars 2 forks source link

Add support for throwing validation #7

Closed br0r closed 9 years ago

br0r commented 9 years ago

Duns validation should be able to throw an error when validation fails. Unlike .validate() today, which returns a bool.

Duns.assert('test', Duns.number()); // Throws err
silfverstrom commented 9 years ago

I like this idea - would be easy to implement as well.