Creates a reducer that accumulates the min of its individual item values.
()
| 74 | |
| 75 | /** Creates a reducer that accumulates the min of its individual item values. */ |
| 76 | min<T extends Date | number>(): MetadataReducer<T | undefined, T | undefined> { |
| 77 | return { |
| 78 | reduce: (acc, item) => { |
| 79 | if (acc === undefined || item === undefined) { |
| 80 | return acc ?? item; |
| 81 | } |
| 82 | return item < acc ? item : acc; |
| 83 | }, |
| 84 | getInitial: () => undefined, |
| 85 | }; |
| 86 | }, |
| 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> { |
no outgoing calls
no test coverage detected