@cto.af/utils - v1.2.0
    Preparing search index...

    Function promiseWithResolvers

    • Polyfill for Promise.withResolvers. Once node 22 is the minimum version, this should be removed.

      Type Parameters

      • T

        Return type for resolve.

      Returns PromiseWithResolvers<T>

      An object containing a new Promise object and two functions to resolve or reject it, corresponding to the two parameters passed to the executor of the Promise() constructor.