UNPKG

sequency

Version:

Functional sequences for processing iterable data in JavaScript

14 lines (13 loc) 677 B
import Sequence from "./Sequence"; export declare class ReduceIndexed { /** * Reduces the whole sequence to a single value by invoking `operation` with each element * from left to right. For every invocation of the operation `acc` is the result of the last * invocation. For the first invocation of the operation `acc` is the first element of the * sequence. In addition the `index` of the current element is also passed to the operation. * * @param {(index: number, acc: S, element: T) => S} operation * @returns {S} */ reduceIndexed<S, T extends S>(this: Sequence<T>, operation: (index: number, acc: S, element: T) => S): S; }