Interface for rule builder objects that can be converted into validation rules. Rule builders provide a fluent API for configuring validation rules before converting them into executable validations.
class MinLengthBuilder implements RuleBuilder { constructor(private length: number) {} [VALIDATION](): Validation<{ length: number }> { return { rule: minLengthRule, options: { length: this.length } } }} Copy
class MinLengthBuilder implements RuleBuilder { constructor(private length: number) {} [VALIDATION](): Validation<{ length: number }> { return { rule: minLengthRule, options: { length: this.length } } }}
Converts the rule builder into an executable validation. This method is called internally when the rule is applied to a schema.
Interface for rule builder objects that can be converted into validation rules. Rule builders provide a fluent API for configuring validation rules before converting them into executable validations.
Example