or
Learn about the available options, methods and use cases.
Usage
import e from "validator";
await e.or([e.string(), e.number(), e.boolean()])
.validate(10); // returns 10Options
interface IOrValidatorOptions extends TBaseValidatorOptions {
/**
* By default all the string validators are moved at the end of the union validators for better validator matching.
*
* Pass `true` to disable validators sorting.
*/
disableValidatorSorting?: boolean;
}Methods
Last updated