Creates a new validation rule and sets its values.
a list of constants that value must be excluded from
Validates the given value. None of the values set in this ExcludedRule object must exist in the value that is given for validation to pass.
the dot notation path to the value that is to be validated.
(not used in this implementation).
the value that is to be validated.
the results of the validation.
Generated using TypeDoc
Validation rule to check that value is excluded from the list of constants.
IValidationRule
Example
let schema = new Schema() .withRule(new ExcludedRule(1, 2, 3)); schema.validate(2); // Result: 2 must not be one of 1, 2, 3 schema.validate(10); // Result: no errors