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

Function max

packages/forms/signals/src/api/rules/metadata.ts:95–105  ·  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

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> {
96 return {
97 reduce: (acc, item) => {
98 if (acc === undefined || item === undefined) {
99 return acc ?? item;
100 }
101 return item > acc ? item : acc;
102 },
103 getInitial: () => undefined,
104 };
105 },
106
107 /** Creates a reducer that logically or's its accumulated value with each individual item value. */
108 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