webdetector/.cache/e9/a02341a7110eb59cefe154e6ebf658.json
2018-12-21 13:36:28 +01:00

1 line
18 KiB
JSON

{"id":"../node_modules/rxjs/_esm5/internal/operators/reduce.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/reduce.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/operators/reduce.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/package.json","includedInParent":true,"mtime":1545395355370},{"name":"./scan","loc":{"line":2,"column":21},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/reduce.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/scan.js"},{"name":"./takeLast","loc":{"line":3,"column":25},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/reduce.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js"},{"name":"./defaultIfEmpty","loc":{"line":4,"column":31},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/reduce.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js"},{"name":"../util/pipe","loc":{"line":5,"column":21},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/reduce.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/pipe.js"}],"generated":{"js":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.reduce = reduce;\n\nvar _scan = require(\"./scan\");\n\nvar _takeLast = require(\"./takeLast\");\n\nvar _defaultIfEmpty = require(\"./defaultIfEmpty\");\n\nvar _pipe = require(\"../util/pipe\");\n\n/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */\nfunction reduce(accumulator, seed) {\n if (arguments.length >= 2) {\n return function reduceOperatorFunctionWithSeed(source) {\n return (0, _pipe.pipe)((0, _scan.scan)(accumulator, seed), (0, _takeLast.takeLast)(1), (0, _defaultIfEmpty.defaultIfEmpty)(seed))(source);\n };\n }\n\n return function reduceOperatorFunction(source) {\n return (0, _pipe.pipe)((0, _scan.scan)(function (acc, value, index) {\n return accumulator(acc, value, index + 1);\n }), (0, _takeLast.takeLast)(1))(source);\n };\n}","map":{"mappings":[{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":8,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":4,"column":0},"generated":{"line":10,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":6,"column":0},"generated":{"line":12,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":62,"column":0},"generated":{"line":14,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":2,"column":0},"generated":{"line":16,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":2},"generated":{"line":17,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":6},"generated":{"line":17,"column":9}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":2},"generated":{"line":17,"column":15}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":16},"generated":{"line":17,"column":16}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":2},"generated":{"line":17,"column":27}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":29},"generated":{"line":17,"column":29}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":2},"generated":{"line":17,"column":33}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":68,"column":29},"generated":{"line":17,"column":35}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":4},"generated":{"line":18,"column":6}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":11},"generated":{"line":18,"column":15}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":11},"generated":{"line":18,"column":16}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":4},"generated":{"line":18,"column":22}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":20},"generated":{"line":18,"column":26}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":69,"column":20},"generated":{"line":18,"column":29}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":6},"generated":{"line":19,"column":11}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":18},"generated":{"line":19,"column":20}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":6},"generated":{"line":19,"column":50}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":43},"generated":{"line":19,"column":51}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":6},"generated":{"line":19,"column":57}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":70,"column":56},"generated":{"line":19,"column":59}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":13}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":29}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":45}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":56}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":58}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":62}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":63}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":65}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":89}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":90}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":91}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":93}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":129}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":133}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":134}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":136}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":142}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":71,"column":6},"generated":{"line":20,"column":143}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":72,"column":3},"generated":{"line":21,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":73,"column":2},"generated":{"line":22,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":74,"column":4},"generated":{"line":24,"column":9}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":75,"column":6},"generated":{"line":24,"column":18}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":74,"column":4},"generated":{"line":24,"column":40}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":75,"column":20},"generated":{"line":24,"column":41}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":74,"column":4},"generated":{"line":24,"column":47}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":75,"column":30},"generated":{"line":24,"column":49}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":11}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":27}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":43}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":53}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":56}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":58}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":63}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":65}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":70}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":25,"column":72}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":13}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":24}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":25}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":28}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":30}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":35}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":37}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":42}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":45}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":46}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":26,"column":47}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":0}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":5}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":6}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":8}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":32}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":33}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":34}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":36}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":42}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":78,"column":4},"generated":{"line":27,"column":43}},{"source":"../../../src/internal/operators/reduce.ts","name":null,"original":{"line":79,"column":1},"generated":{"line":28,"column":0}}],"sources":{"../../../src/internal/operators/reduce.ts":"import { Observable } from '../Observable';\nimport { scan } from './scan';\nimport { takeLast } from './takeLast';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\nimport { pipe } from '../util/pipe';\n\n/* tslint:disable:max-line-length */\nexport function reduce<T>(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction<T>;\nexport function reduce<T>(accumulator: (acc: T[], value: T, index: number) => T[], seed: T[]): OperatorFunction<T, T[]>;\nexport function reduce<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed?: R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns the\n * accumulated result when the source completes, given an optional seed value.\n *\n * <span class=\"informal\">Combines together all values emitted on the source,\n * using an accumulator function that knows how to join a new source value into\n * the accumulation from the past.</span>\n *\n * ![](reduce.png)\n *\n * Like\n * [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce),\n * `reduce` applies an `accumulator` function against an accumulation and each\n * value of the source Observable (from the past) to reduce it to a single\n * value, emitted on the output Observable. Note that `reduce` will only emit\n * one value, only when the source Observable completes. It is equivalent to\n * applying operator {@link scan} followed by operator {@link last}.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events that happened in 5 seconds\n * ```javascript\n * const clicksInFiveSeconds = fromEvent(document, 'click').pipe(\n * takeUntil(interval(5000)),\n * );\n * const ones = clicksInFiveSeconds.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.reduce((acc, one) => acc + one, seed);\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link count}\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link scan}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator The accumulator function\n * called on each source value.\n * @param {R} [seed] The initial accumulation value.\n * @return {Observable<R>} An Observable that emits a single value that is the\n * result of accumulating the values emitted by the source Observable.\n * @method reduce\n * @owner Observable\n */\nexport function reduce<T, R>(accumulator: (acc: R, value: T, index?: number) => R, seed?: R): OperatorFunction<T, R> {\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n return function reduceOperatorFunctionWithSeed(source: Observable<T>): Observable<R> {\n return pipe(scan(accumulator, seed), takeLast(1), defaultIfEmpty(seed))(source);\n };\n }\n return function reduceOperatorFunction(source: Observable<T>): Observable<R> {\n return pipe(\n scan((acc: R, value: T, index: number): R => accumulator(acc, value, index + 1)),\n takeLast(1),\n )(source);\n };\n}\n"},"lineCount":null}},"hash":"1d5e881629f977c18fe16d54fbbf1b49","cacheData":{"env":{}}}