none function
- List<
IValidator> validators, { - String? message,
Passes the test if none of the validators pass
Usage Examples:
// Ensure a string is NOT a reserved keyword
final notReserved = none([
isEq("class"),
isEq("function"),
isEq("var"),
isEq("const"),
]);
notReserved.validate("myVariable"); // Valid
notReserved.validate("class"); // Invalid
// Validate that a number is not in a forbidden range
final notForbidden = none([
isInRange(0, 10), // Not 0-10
isInRange(50, 60), // Not 50-60
]);
Implementation
IValidator none(List<IValidator> validators, {String? message}) {
return NoneValidator(validators, message: message);
}