iteragain
Version:
Javascript Iterable/Iterator/Generator-function utilities.
10 lines • 877 B
TypeScript
import type { IteratorOrIterable } from './types';
/** Reduces the input iterator to a single value. */
export declare function reduce<T>(arg: IteratorOrIterable<T>, reducer: (accumulator: T, value: T) => T): T;
export declare function reduce<T>(reducer: (accumulator: T, value: T) => T): (arg: IteratorOrIterable<T>) => T;
export declare function reduce<T, R>(arg: IteratorOrIterable<T>, reducer: (accumulator: R, value: T) => R, initialValue: R): R;
export declare function reduce<T, R>(reducer: (accumulator: R, value: T) => R, initialValue: R): (arg: IteratorOrIterable<T>) => R;
export declare function reduce<T, R>(arg: IteratorOrIterable<T>, reducer: (accumulator: T | R, value: T) => R): R;
export declare function reduce<T, R>(reducer: (accumulator: T | R, value: T) => R): (arg: IteratorOrIterable<T>) => R;
export default reduce;
//# sourceMappingURL=reduce.d.ts.map