isPromise.mjs 256 B

12345678910
  1. /**
  2. * Returns true if the value acts like a Promise, i.e. has a "then" function,
  3. * otherwise returns false.
  4. */
  5. export function isPromise(value) {
  6. return (
  7. typeof (value === null || value === void 0 ? void 0 : value.then) ===
  8. 'function'
  9. );
  10. }