Add "tryValidate", "toJSON" method and "in" validation rule
tryValidate
The tryValidate
method can be used to perform validation without throwing a validation error. Instead, the errors are returned as the return value of the method, which is a tuple.
const [error, result] = validator.tryValidate({ data: {} })
The try
prefix is inspired from the Java world.
in
The in
validation rule has been added for the VineNumber
schema type and can be used to ensure the value of field is part of the allowed values list.
toJSON
The validator.toJSON
method can be used to get the validator and its refs as JSON.
Commits
- feat: add tryValidate method to Vine (a70ff38)
- feat: add tryValidate method (cebb8e0)
- fix: add "in" rule in default number rules (#54) (39204e4)
- chore: migrate to release-it (0b5e212)
- feat: add in rule for number (#53) (72912af)
- feat: export modifiers (#48) (34e07fc)
- chore: update dependencies (a7e18b7)
- style: reformat codebase (62d450c)
- feat: add validator.toJSON method to get compiled schema and refs (5259933)
What's Changed
- feat: export modifiers by @adamcikado in #48
- feat: add in rule for number (#44) by @FACON-Nicolas in #53
- fix: add "in" rule in default number rules (#44) by @FACON-Nicolas in #54
New Contributors
- @adamcikado made their first contribution in #48
- @FACON-Nicolas made their first contribution in #53
Full Changelog: v2.0.0...v2.1.0