isPromise.mjs 291 B

12345678
  1. /**
  2. * Returns true if the value acts like a Promise, i.e. has a "then" function,
  3. * otherwise returns false.
  4. */
  5. // eslint-disable-next-line no-redeclare
  6. export default function isPromise(value) {
  7. return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';
  8. }