![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/node_modules/rxjs/_esm5/internal/operators/ |
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ import * as tslib_1 from "tslib"; import { Subscriber } from '../Subscriber'; export function count(predicate) { return function (source) { return source.lift(new CountOperator(predicate, source)); }; } var CountOperator = /*@__PURE__*/ (function () { function CountOperator(predicate, source) { this.predicate = predicate; this.source = source; } CountOperator.prototype.call = function (subscriber, source) { return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source)); }; return CountOperator; }()); var CountSubscriber = /*@__PURE__*/ (function (_super) { tslib_1.__extends(CountSubscriber, _super); function CountSubscriber(destination, predicate, source) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.source = source; _this.count = 0; _this.index = 0; return _this; } CountSubscriber.prototype._next = function (value) { if (this.predicate) { this._tryPredicate(value); } else { this.count++; } }; CountSubscriber.prototype._tryPredicate = function (value) { var result; try { result = this.predicate(value, this.index++, this.source); } catch (err) { this.destination.error(err); return; } if (result) { this.count++; } }; CountSubscriber.prototype._complete = function () { this.destination.next(this.count); this.destination.complete(); }; return CountSubscriber; }(Subscriber)); //# sourceMappingURL=count.js.map