If all validators fail, the validator that produced an error at the deepest path will have its
error message bubbled. If all validators failed at the current depth, a concatenation of
validator descriptions will be used.
For example:
orValidators(number(), string()).validate(false) will produce the message:
'Expected (number | string), but was false, At: '
And:
orValidators(number(), object({ childProp: number() })).validate({ childProp: 'not-a-number' })
will produce:
'Expected number, but was "not-a-number", At: childProp'
Validates that one of the given validators pass.
If all validators fail, the validator that produced an error at the deepest path will have its error message bubbled. If all validators failed at the current depth, a concatenation of validator descriptions will be used.
For example:
orValidators(number(), string()).validate(false)will produce the message: 'Expected (number | string), but was false, At: 'And:
orValidators(number(), object({ childProp: number() })).validate({ childProp: 'not-a-number' })will produce: 'Expected number, but was "not-a-number", At: childProp'Param: validators
The validators to test.