Creates a reducer that accumulates a the max of its individual item values.
()
| 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> { |
no outgoing calls
no test coverage detected