jty
    Preparing search index...

    Function isPromise

    • Checks if a value is a native Promise instance.

      This guard is intentionally strict and uses instanceof Promise semantics. It does not use .then() / .catch() feature sniffing.

      Use isPromiseLike if you want to accept general thenables.

      Parameters

      • x: unknown

      Returns x is Promise<unknown>

      isPromise(Promise.resolve(123)) => true
      isPromise(new Promise(() => {})) => true
      isPromise({ then: () => {}, catch: () => {} }) => false
      isPromise(42) => false