MCPcopy Index your code
hub / github.com/angular/angular / mergeErrors

Function mergeErrors

packages/forms/src/validators.ts:623–630  ·  view source on GitHub ↗
(arrayOfErrors: (ValidationErrors | null)[])

Source from the content-addressed store, hash-verified

621}
622
623function mergeErrors(arrayOfErrors: (ValidationErrors | null)[]): ValidationErrors | null {
624 let res: {[key: string]: any} = {};
625 arrayOfErrors.forEach((errors: ValidationErrors | null) => {
626 res = errors != null ? {...res!, ...errors} : res!;
627 });
628
629 return Object.keys(res).length === 0 ? null : res;
630}
631
632type GenericValidatorFn = (control: AbstractControl) => any;
633

Callers 1

composeFunction · 0.85

Calls 2

keysMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…