Check if value is positive and even
value
const chainedValidator = validate(chain( valueValidator(isPositive, "err1"), valueValidator(isEven, "err2")));const result = chainedValidator(-1);console.log(result); // [{ path: "$", message: "err1", value: -1 }]
Rest
Generated using TypeDoc
Example
Check if
valueis positive and evenReturns