frontend/.pnpm-store/v3/files/dd/ff9bfbf9ca763192419410670176ded9bf3033e657ddb6ab07f40c3a92f953e91be7c7d7a56c09cfe1eb7086e02f248b42d7f65816b8518b6a0a125d5955a7

17 lines
718 B
Plaintext

/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */
import { scan } from './scan';
import { takeLast } from './takeLast';
import { defaultIfEmpty } from './defaultIfEmpty';
import { pipe } from '../util/pipe';
export function reduce(accumulator, seed) {
if (arguments.length >= 2) {
return function reduceOperatorFunctionWithSeed(source) {
return pipe(scan(accumulator, seed), takeLast(1), defaultIfEmpty(seed))(source);
};
}
return function reduceOperatorFunction(source) {
return pipe(scan(function (acc, value, index) { return accumulator(acc, value, index + 1); }), takeLast(1))(source);
};
}
//# sourceMappingURL=reduce.js.map