Skip to main content

isPromise

Callable

  • isPromise(object: unknown): boolean

  • An alternative to the node function isPromise that exists in util/types because it is not available on the browser.


    Parameters

    • object: unknown

      to check if it is a Promise

    Returns boolean

    true if it is an object or a function that has a then function. And returns false otherwise.