(initial: LazyArg<S>, f: (s: S, input: In) => S)
| 1455 | * @since 4.0.0 |
| 1456 | */ |
| 1457 | export const reduce = <S, In>(initial: LazyArg<S>, f: (s: S, input: In) => S): Sink<S, In> => |
| 1458 | reduceArray(initial, (s, arr) => { |
| 1459 | for (let i = 0; i < arr.length; i++) { |
| 1460 | s = f(s, arr[i]) |
| 1461 | } |
| 1462 | return s |
| 1463 | }) |
| 1464 | |
| 1465 | /** |
| 1466 | * A sink that reduces its inputs using the provided function `f` starting from |
nothing calls this directly
no test coverage detected