Change
2.0.0
Bug fix
- fix the bug that validator will occur circular references in some situation
Features
- Rewrite lots of validation procedure
- Validator can use
strictmode andsloppymode to validate data - Built-in Model can extend custom config
- More config for Function validation
- Add the support of JS Doc
- Add the validation of AsyncFunction
- Validator can climb the prototype chain by setting
enableClimb
BREAKING CHANGES
- deprecated api:
ParamValidator.deepClone(),isNaN
1.4.0
Features
- add Custom Function, allow user to fully customize validation rules
- add Built-in Model
BREAKING CHANGES
- when the option
requiredisfalse, the value ofundefinedcan be accepted and will not cause a wrong validation, such as { name: undefined }. - when validator receives a value of
undefinedand Data Model has adefaultvalue, default value will coverundefined. So if you want to match aundefinedvalue, please make sure you don't define a default value.
1.3.2
- update README.md
1.3.1
Features
- improve the compatibility of ES module
1.3.0
Features
- add the validation of empty string
- add the validation of the length, max length and min length of string
- add the validation of NaN on Number
1.2.1
- update README.md
1.2.0
Features
- add simple model to construct a data model
1.1.0
Bug Fixes
- type:
undefinedcan not be matched when there is no field in the data.
Features
- add
objItemsandarrItemsto distinguish the same optionitemsbefore
1.0.0
- param-validator.js released