A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
MIT License
Bot releases are visible (Hide)
Published by garygreen about 9 years ago
registerAsync()
and pass callbacks to passes(func)
and fails(func)
.array
, between
, and required_if
validation rules.Validator.make(..)
use new Validator(..)
instead.integer
rule not allowing unsigned integers.size
, min
, max
..errors.get('username')
or .errors.first('username')
rather than .errors.username
.passes()
or fails()
(should now be called first before accessing .errors
or .errorCount
)..setAttributeFormatter(function)
(by default replaces all _[] with spaces.).setAttributeNames()
.useLang()
and customise/add new languages setMessages()
.getMessages(<lang>)
to get the raw messages for given language.getDefaultLang()
to return the default language that is being used.