guillaumepotier / validator.js

Powerful objects and strings validation in javascript for Node and the browser
http://validatorjs.org
MIT License
255 stars 39 forks source link

added parenthesis for || operator precedence in __toString() for the case when this.violation==='undefined' #48

Closed venkatperi closed 8 years ago

venkatperi commented 9 years ago

check { email: "ab.com" } against { email: new Assert().Email() } Before: __toString() output is: 'Email assert failed for "ab.comundefined' After: 'Email assert failed for "ab.com'

guillaumepotier commented 9 years ago

This is great!

Could you please add your above example in the test suite?

Thx

guillaumepotier commented 8 years ago

Thanks!