Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### New Features * **Typing**: Validators may have a specific input and especially output type. * `V.objectType()` builder can be used to build an ObjectValidator with inferred type. * Validator (output/result) type can be acquired with `VType<typeof validator>`. * Direct, chainable support for most used "next" validation rules (e.g. `V.number().min(1).max(2)`): * `V.string()` supports `notEmpty`, `notBlank` and `pattern`. * `V.number()` supports `min` and `max`. ### Breaking changes: * V.string() and some other validators do not support String object as input any more. * V.number() does not support Number object as input any more. * Validators that accept multiple subvalidators (`V.optional`, `V.required`, `V.check`, `V.if`, `V.whenGroup`, `V.json` and `ObjectModel#next`) are combined using `V.compositionOf` instead of `V.allOf` as composition makes more sense in general. However, if there are multiple parents with next validators, those are still combined with `V.allOf` as they are not aware of each other. * Internal Validator#validatePath returns now a promise (success, or reject) of value directly instead of ValidationResult
- Loading branch information