MCPcopy
hub / github.com/angular/angular / getOption

Function getOption

packages/forms/signals/src/api/rules/validation/util.ts:49–54  ·  view source on GitHub ↗
(
  opt: Exclude<TOption, Function> | LogicFn<TValue, TOption, TPathKind> | undefined,
  ctx: FieldContext<TValue, TPathKind>,
)

Source from the content-addressed store, hash-verified

47 * @returns The value for the option.
48 */
49export function getOption<TOption, TValue, TPathKind extends PathKind = PathKind.Root>(
50 opt: Exclude<TOption, Function> | LogicFn<TValue, TOption, TPathKind> | undefined,
51 ctx: FieldContext<TValue, TPathKind>,
52): TOption | undefined {
53 return opt instanceof Function ? opt(ctx) : opt;
54}
55
56/**
57 * Checks if the given value is considered empty. Empty values are: null, undefined, '', false, NaN.

Callers 9

requiredFunction · 0.90
minFunction · 0.90
maxDateFunction · 0.90
minLengthFunction · 0.90
minDateFunction · 0.90
maxFunction · 0.90
emailFunction · 0.90
maxLengthFunction · 0.90
patternFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…