isPromise.js 386 B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isPromise;
  6. /**
  7. * Returns true if the value acts like a Promise, i.e. has a "then" function,
  8. * otherwise returns false.
  9. */
  10. // eslint-disable-next-line no-redeclare
  11. function isPromise(value) {
  12. return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';
  13. }