export const mutexifyAuth = (authFn) => {
    const promises = new Map();
    return (input, init) => {
        const k = `${input.href} ${JSON.stringify(init)}`;
        const p = promises.get(k) ?? authFn(input, init).finally(() => promises.delete(k));
        if (!promises.has(k)) {
            promises.set(k, p);
        }
        return p;
    };
};
//# sourceMappingURL=mutexifyAuth.js.map