MCPcopy Create free account
hub / github.com/angular/angular / normalizeErrors

Function normalizeErrors

packages/forms/signals/src/api/rules/validation/util.ts:71–79  ·  view source on GitHub ↗
(error: OneOrMany<T> | undefined)

Source from the content-addressed store, hash-verified

69 * into a list of errors.
70 */
71export function normalizeErrors<T>(error: OneOrMany<T> | undefined): readonly T[] {
72 if (error === undefined) {
73 return [];
74 }
75 if (Array.isArray(error)) {
76 return error as readonly T[];
77 }
78 return [error as T];
79}

Callers 1

setRawValueFunction · 0.90

Calls 1

isArrayMethod · 0.80

Tested by

no test coverage detected