Creates a new validation rule and sets its values.
a list of constants that value must be included to
Validates a given value against this rule.
a dot notation path to the value.
a schema this rule is called from
a value to be validated.
a list with validation results to add new results.
Generated using TypeDoc
Validation rule to check that value is included into the list of constants.
IValidationRule
Example
let schema = new Schema() .withRule(new IncludedRule(1, 2, 3)); schema.validate(2); // Result: no errors schema.validate(10); // Result: 10 must be one of 1, 2, 3