export const promiseWithResolvers = () => {
    let resolve;
    let reject;
    const promise = new Promise((res, rej) => {
        resolve = res;
        reject = rej;
    });
    if (!resolve || !reject)
        throw new Error("Failed to create promise");
    return { promise, resolve, reject };
};
//# sourceMappingURL=promiseWithResolvers.js.map