- Fixes required_if (mikeerickson#148)
- New rules 'required_unless', 'required_with', 'required_with_all', 'required_without', 'required_without_all' (mikeerickson#148)
- Adds Persian/Farsi (mikeerickson#149)
- Adds Vietnamese (mikeerickson#141)
- Adds Portuguese language
- Add Norwegian Bokmål (nb_NO) localization
- Adds Greek language support
- Adds "sometimes" rule
- add optional check for checkAsync method and add additional test specs for checkAsync methods
Adds Traditional Chinese translations
- Adds Chinese translations
- Adds Turkish translations
- Adds German translation file
- Fixes mikeerickson#102
- Fixes mikeerickson#104
- Adds date rule
- Released nested rules feature
- Discovered nested rules broke some custom validation rules that handled nested objects so removed this feature in 2.x to follow semver. See issue.
- Introduced nested rules
- Documentation updates for language support
- Adds lang/es.js
- Support arrays with "in" rule
- Added asynchronous validation
registerAsync()
and pass callbacks topasses(func)
andfails(func)
. - Added
array
,between
, andrequired_if
validation rules. - Removed
Validator.make(..)
usenew Validator(..)
instead. - Fixed
integer
rule not allowing unsigned integers. - Fixed attempting to validate non-required rules when there's nothing to validate.
- Fixed numeric comparison rules where value is a string:
size
,min
,max
. - Fixed error messages for attributes with names: 'has', 'get', or 'first'.
- Errors must now be accessed by
.errors.get('username')
or.errors.first('username')
rather than.errors.username
. - Only validate when calling
passes()
orfails()
(should now be called first before accessing.errors
or.errorCount
). - Added ability to format attributes
.setAttributeFormatter(function)
(by default replaces all _[] with spaces.) - Added ability to set custom attribute names to display in errors
.setAttributeNames()
. - Added ability to switch language
useLang()
and customise/add new languagessetMessages()
. - Added
getMessages(<lang>)
to get the raw messages for given language. - Added
getDefaultLang()
to return the default language that is being used. - Use source files in node (no longer uses dist).
- Improved structuring of library, use Browserify, switch to mocha for testing.
- Adds regex pattern rules
- Adds alternative array syntax (instead of pipe) for declaring validation rules
- email validation rule now supports emails with a dot before the @ symbol, like [email protected]
- Adds Validator.make() as an alias to new Validator()
- Adds .all() method on validation errors object
- Adds .has() method on validation errors object
- Broke up library into smaller files that get combined during build
- Replaces jasmine-node with Karma and Grunt watch for testing
- Adds Istanbul for test coverage reporting
- Adds language support
- Updates travis config file to use Node 0.10 instead of 0.8