UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

1 lines 1.64 kB
{"version":3,"sources":["add/iterable-operators/reduce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY/C,MAAM,UAAU,WAAW,CAEzB,oBAA8F,EAC9F,IAAQ;IAER,OAAO,MAAM,CACX,IAAI;IACJ,6CAA6C;IAC7C,OAAO,oBAAoB,KAAK,UAAU;QACxC,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;YACpB,CAAC,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE;YACpD,CAAC,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE;QACxC,CAAC,CAAC,oBAAoB,CACzB,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,WAAW,CAAC","file":"reduce.js","sourcesContent":["import { IterableX } from '../../iterable/iterablex';\nimport { reduce } from '../../iterable/reduce';\nimport { ReduceOptions } from '../../iterable/reduceoptions';\n\n/**\n * @ignore\n */\nexport function reduceProto<T, R = T>(this: IterableX<T>, options: ReduceOptions<T, R>): R;\nexport function reduceProto<T, R = T>(\n this: IterableX<T>,\n accumulator: (accumulator: R, current: T, index: number) => R,\n seed?: R\n): R;\nexport function reduceProto<T, R = T>(\n this: IterableX<T>,\n optionsOrAccumulator: ReduceOptions<T, R> | ((accumulator: R, current: T, index: number) => R),\n seed?: R\n): R {\n return reduce(\n this,\n // eslint-disable-next-line no-nested-ternary\n typeof optionsOrAccumulator === 'function'\n ? arguments.length > 1\n ? { 'callback': optionsOrAccumulator, 'seed': seed }\n : { 'callback': optionsOrAccumulator }\n : optionsOrAccumulator\n );\n}\n\nIterableX.prototype.reduce = reduceProto;\n\ndeclare module '../../iterable/iterablex' {\n interface IterableX<T> {\n reduce: typeof reduceProto;\n }\n}\n"]}