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