biofriction-wp-theme/node_modules/rxjs/operators/filter.js.map

1 line
5.1 KiB
Plaintext

{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../src/operators/filter.ts"],"names":[],"mappings":";;;;;;AACA,2BAA2B,eAAe,CAAC,CAAA;AAU3C,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,gBAA0B,SAA+C,EAC/C,OAAa;IACrC,MAAM,CAAC,gCAAgC,MAAqB;QAC1D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AALe,cAAM,SAKrB,CAAA;AAED;IACE,wBAAoB,SAA+C,EAC/C,OAAa;QADb,cAAS,GAAT,SAAS,CAAsC;QAC/C,YAAO,GAAP,OAAO,CAAM;IACjC,CAAC;IAED,6BAAI,GAAJ,UAAK,UAAyB,EAAE,MAAW;QACzC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1F,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,IAQC;AAED;;;;GAIG;AACH;IAAkC,oCAAa;IAI7C,0BAAY,WAA0B,EAClB,SAA+C,EAC/C,OAAY;QAC9B,kBAAM,WAAW,CAAC,CAAC;QAFD,cAAS,GAAT,SAAS,CAAsC;QAC/C,YAAO,GAAP,OAAO,CAAK;QAJhC,UAAK,GAAW,CAAC,CAAC;IAMlB,CAAC;IAED,qDAAqD;IACrD,qEAAqE;IAC3D,gCAAK,GAAf,UAAgB,KAAQ;QACtB,IAAI,MAAW,CAAC;QAChB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAClE,CAAE;QAAA,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,CAAC;QACT,CAAC;QACD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AAxBD,CAAkC,uBAAU,GAwB3C","sourcesContent":["import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { TeardownLogic } from '../Subscription';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../interfaces';\n\n/* tslint:disable:max-line-length */\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S,\n thisArg?: any): OperatorFunction<T, S>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * <img src=\"./img/filter.png\" width=\"100%\">\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * @example <caption>Emit only click events whose target was a DIV element</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');\n * clicksOnDivs.subscribe(x => console.log(x));\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T> {\n return function filterOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\n\nclass FilterOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean,\n private thisArg?: any) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FilterSubscriber<T> extends Subscriber<T> {\n\n count: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean,\n private thisArg: any) {\n super(destination);\n }\n\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n protected _next(value: T) {\n let result: any;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n }\n}"]}