Creates a new validation rule and sets its values
a rule to be negated.
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 negate another rule. When embedded rule returns no errors, than this rule return an error. When embedded rule return errors, than the rule returns no errors.
IValidationRule
Example
let schema = new Schema() .withRule(new NotRule( new ValueComparisonRule("EQ", 1) )); schema.validate(1); // Result: error schema.validate(5); // Result: no error