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