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

Function mergeValidators

packages/forms/src/validators.ts:718–723  ·  view source on GitHub ↗
(controlValidators: V | V[] | null, dirValidator: V)

Source from the content-addressed store, hash-verified

716 * validators as an array.
717 */
718export function mergeValidators<V>(controlValidators: V | V[] | null, dirValidator: V): V[] {
719 if (controlValidators === null) return [dirValidator];
720 return Array.isArray(controlValidators)
721 ? [...controlValidators, dirValidator]
722 : [controlValidators, dirValidator];
723}
724
725/**
726 * Retrieves the list of raw synchronous validators attached to a given control.

Callers 1

setUpValidatorsFunction · 0.90

Calls 1

isArrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…