MCPcopy
hub / github.com/angular/angular / metadata

Function metadata

packages/forms/signals/src/api/rules/metadata.ts:30–50  ·  view source on GitHub ↗
(
  path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
  key: TKey,
  logic: NoInfer<
    LogicFn<
      TValue,
      TKey extends LimitSelectionKey ? LimitKey<TValue> : MetadataSetterType<TKey>,
      TPathKind
    >
  >,
)

Source from the content-addressed store, hash-verified

28 * @publicApi 22.0
29 */
30export function metadata<
31 TValue,
32 TKey extends MetadataKey<any, any, any>,
33 TPathKind extends PathKind = PathKind.Root,
34>(
35 path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
36 key: TKey,
37 logic: NoInfer<
38 LogicFn<
39 TValue,
40 TKey extends LimitSelectionKey ? LimitKey<TValue> : MetadataSetterType<TKey>,
41 TPathKind
42 >
43 >,
44): TKey {
45 assertPathIsCurrent(path);
46
47 const pathNode = FieldPathNode.unwrapFieldPath(path);
48 pathNode.builder.addMetadataRule(key, logic);
49 return key;
50}
51
52/**
53 * A reducer that determines the accumulated value for a metadata key by reducing the individual

Callers 15

requiredFunction · 0.90
minFunction · 0.90
maxDateFunction · 0.90
minLengthFunction · 0.90
minDateFunction · 0.90
maxFunction · 0.90
maxLengthFunction · 0.90
validateAsyncFunction · 0.90
patternFunction · 0.90
validateStandardSchemaFunction · 0.90

Calls 3

assertPathIsCurrentFunction · 0.90
unwrapFieldPathMethod · 0.80
addMetadataRuleMethod · 0.45

Tested by 2

sFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…