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

Function isEmpty

packages/forms/signals/src/api/rules/validation/util.ts:60–65  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

58 * non-finite numbers (NaN, Infinity, -Infinity).
59 */
60export function isEmpty(value: unknown): boolean {
61 if (typeof value === 'number') {
62 return !Number.isFinite(value);
63 }
64 return value === '' || value === false || value == null;
65}
66
67/**
68 * Normalizes validation errors (which can be a single error, an array of errors, or undefined)

Callers 6

requiredFunction · 0.90
minLengthFunction · 0.90
emailFunction · 0.90
maxLengthFunction · 0.90
patternFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected