* Merges synchronous validators into a single validator function. * See `Validators.compose` for additional information.
(validators: (ValidatorFn | null | undefined)[] | null)
| 663 | * See `Validators.compose` for additional information. |
| 664 | */ |
| 665 | function compose(validators: (ValidatorFn | null | undefined)[] | null): ValidatorFn | null { |
| 666 | if (!validators) return null; |
| 667 | const presentValidators: ValidatorFn[] = validators.filter(isPresent) as any; |
| 668 | if (presentValidators.length == 0) return null; |
| 669 | |
| 670 | return function (control: AbstractControl) { |
| 671 | return mergeErrors(executeValidators<ValidatorFn>(control, presentValidators)); |
| 672 | }; |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * Accepts a list of validators of different possible shapes (`Validator` and `ValidatorFn`), |
no test coverage detected
searching dependent graphs…