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

Function max

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

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

()

Source from the content-addressed store, hash-verified

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> {
90 return {
91 reduce: (acc, item) => {
92 if (acc === undefined || item === undefined) {
93 return acc ?? item;
94 }
95 return item > acc ? item : acc;
96 },
97 getInitial: () => undefined,
98 };
99 },
100
101 /** Creates a reducer that logically or's its accumulated value with each individual item value. */
102 or(): MetadataReducer<boolean, boolean> {

Callers 4

TestCmpClass · 0.90
TestCmpClass · 0.50
max.spec.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected