UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

5 lines (4 loc) 421 B
type ScanReducer<TAccumulator, TValue> = (accumulator: TAccumulator, value: TValue, index: number, array: TValue[]) => TAccumulator; export declare function scan<TValue>(values: TValue[] | unknown, reducer: ScanReducer<TValue, TValue>): TValue[]; export declare function scan<TAccumulator, TValue>(values: TValue[] | unknown, initial: TAccumulator, reducer: ScanReducer<TAccumulator, TValue>): TAccumulator[]; export {};