diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js index 2c74dcce0f..0d7ed524e9 100644 --- a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js +++ b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/operators/takeWhile.js @@ -1,23 +1,30 @@ /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ import * as tslib_1 from "tslib"; import { Subscriber } from '../Subscriber'; -export function takeWhile(predicate) { - return function (source) { return source.lift(new TakeWhileOperator(predicate)); }; +export function takeWhile(predicate, inclusive) { + if (inclusive === void 0) { + inclusive = false; + } + return function (source) { + return source.lift(new TakeWhileOperator(predicate, inclusive)); + }; } var TakeWhileOperator = /*@__PURE__*/ (function () { - function TakeWhileOperator(predicate) { + function TakeWhileOperator(predicate, inclusive) { this.predicate = predicate; + this.inclusive = inclusive; } TakeWhileOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate)); + return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive)); }; return TakeWhileOperator; }()); var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) { tslib_1.__extends(TakeWhileSubscriber, _super); - function TakeWhileSubscriber(destination, predicate) { + function TakeWhileSubscriber(destination, predicate, inclusive) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; + _this.inclusive = inclusive; _this.index = 0; return _this; } @@ -39,6 +46,9 @@ var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) { destination.next(value); } else { + if (this.inclusive) { + destination.next(value); + } destination.complete(); } }; |