Register a new validator. @param validator - Validator to register.
(validator: Validator<T>)
| 340 | @param validator - Validator to register. |
| 341 | */ |
| 342 | addValidator(validator: Validator<T>): this { |
| 343 | // Create a new array with the existing validators plus the new one |
| 344 | const validators = [...this.context.validators, validator]; |
| 345 | |
| 346 | // Return a new instance with the updated validators |
| 347 | return this.withValidators(validators); |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | @hidden |
no test coverage detected