PromiseInspection.js 458 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. class PromiseInspection {
  4. constructor(args) {
  5. this._value = args.value;
  6. this._error = args.error;
  7. }
  8. value() {
  9. return this._value;
  10. }
  11. reason() {
  12. return this._error;
  13. }
  14. isRejected() {
  15. return !!this._error;
  16. }
  17. isFulfilled() {
  18. return !!this._value;
  19. }
  20. }
  21. exports.PromiseInspection = PromiseInspection;