silfverorg / duns.js

Javascript schema validator
5 stars 2 forks source link

Duns.string() should have case sensitivity option #56

Open br0r opened 9 years ago

br0r commented 9 years ago
var schema = Duns.string().oneOf('asc', 'desc').caseInsensitive() // or .insensitive perhaps, or any other shorthand.

schema.validate('ASC') //True
br0r commented 9 years ago

If this is implemented, it should probably always do .toLowerCase on param values or something. At least it should be able to mix it with a string regexp.

Duns.string('Foo').match('foo').caseInsensitive().validate(); //True