(initial: LazyArg<S>, f: (s: S, input: In) => S)
| 1386 | * @since 4.0.0 |
| 1387 | */ |
| 1388 | export const reduce = <S, In>(initial: LazyArg<S>, f: (s: S, input: In) => S): Sink<S, In> => |
| 1389 | reduceArray(initial, (s, arr) => { |
| 1390 | for (let i = 0; i < arr.length; i++) { |
| 1391 | s = f(s, arr[i]) |
| 1392 | } |
| 1393 | return s |
| 1394 | }) |
| 1395 | |
| 1396 | /** |
| 1397 | * A sink that reduces its inputs using the provided function `f` starting from |
no test coverage detected