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

Function min

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

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

()

Source from the content-addressed store, hash-verified

80
81 /** Creates a reducer that accumulates the min of its individual item values. */
82 min<T extends Date | number>(): MetadataReducer<T | undefined, T | undefined> {
83 return {
84 reduce: (acc, item) => {
85 if (acc === undefined || item === undefined) {
86 return acc ?? item;
87 }
88 return item < acc ? item : acc;
89 },
90 getInitial: () => undefined,
91 };
92 },
93
94 /** Creates a reducer that accumulates a the max of its individual item values. */
95 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