Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

throwIfEmpty.js 637B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tap_1 = require("./tap");
  4. var EmptyError_1 = require("../util/EmptyError");
  5. exports.throwIfEmpty = function (errorFactory) {
  6. if (errorFactory === void 0) { errorFactory = defaultErrorFactory; }
  7. return tap_1.tap({
  8. hasValue: false,
  9. next: function () { this.hasValue = true; },
  10. complete: function () {
  11. if (!this.hasValue) {
  12. throw errorFactory();
  13. }
  14. }
  15. });
  16. };
  17. function defaultErrorFactory() {
  18. return new EmptyError_1.EmptyError();
  19. }
  20. //# sourceMappingURL=throwIfEmpty.js.map