![]() 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/vreg/node_modules/rxjs/_esm5/internal/operators/ |
/** PURE_IMPORTS_START tslib,_util_EmptyError,_Subscriber PURE_IMPORTS_END */ import * as tslib_1 from "tslib"; import { EmptyError } from '../util/EmptyError'; import { Subscriber } from '../Subscriber'; export function throwIfEmpty(errorFactory) { if (errorFactory === void 0) { errorFactory = defaultErrorFactory; } return function (source) { return source.lift(new ThrowIfEmptyOperator(errorFactory)); }; } var ThrowIfEmptyOperator = /*@__PURE__*/ (function () { function ThrowIfEmptyOperator(errorFactory) { this.errorFactory = errorFactory; } ThrowIfEmptyOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory)); }; return ThrowIfEmptyOperator; }()); var ThrowIfEmptySubscriber = /*@__PURE__*/ (function (_super) { tslib_1.__extends(ThrowIfEmptySubscriber, _super); function ThrowIfEmptySubscriber(destination, errorFactory) { var _this = _super.call(this, destination) || this; _this.errorFactory = errorFactory; _this.hasValue = false; return _this; } ThrowIfEmptySubscriber.prototype._next = function (value) { this.hasValue = true; this.destination.next(value); }; ThrowIfEmptySubscriber.prototype._complete = function () { if (!this.hasValue) { var err = void 0; try { err = this.errorFactory(); } catch (e) { err = e; } this.destination.error(err); } else { return this.destination.complete(); } }; return ThrowIfEmptySubscriber; }(Subscriber)); function defaultErrorFactory() { return new EmptyError(); } //# sourceMappingURL=throwIfEmpty.js.map