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

Function min

packages/forms/signals/src/api/rules/metadata.ts:76–86  ·  view source on GitHub ↗

Creates a reducer that accumulates the min of its individual item values.

()

Source from the content-addressed store, hash-verified

74
75 /** Creates a reducer that accumulates the min of its individual item values. */
76 min<T extends Date | number>(): MetadataReducer<T | undefined, T | undefined> {
77 return {
78 reduce: (acc, item) => {
79 if (acc === undefined || item === undefined) {
80 return acc ?? item;
81 }
82 return item < acc ? item : acc;
83 },
84 getInitial: () => undefined,
85 };
86 },
87
88 /** Creates a reducer that accumulates a the max of its individual item values. */
89 max<T extends Date | number>(): MetadataReducer<T | undefined, T | undefined> {

Callers 4

TestCmpClass · 0.90
TestCmpClass · 0.50
min.spec.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected