@arbidocs/client 0.5.173 → 0.5.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1596,13 +1596,17 @@ function authTokenOf(input, init) {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
function createDedupFetch(originalFetch) {
|
|
1598
1598
|
const inFlightRequests = /* @__PURE__ */ new Map();
|
|
1599
|
+
let writes = 0;
|
|
1599
1600
|
return function dedupFetch(input, init) {
|
|
1600
1601
|
const method = (init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase();
|
|
1601
1602
|
if (method !== "GET") {
|
|
1602
|
-
|
|
1603
|
+
writes++;
|
|
1604
|
+
return originalFetch(input, init).finally(() => {
|
|
1605
|
+
writes++;
|
|
1606
|
+
});
|
|
1603
1607
|
}
|
|
1604
1608
|
const url = input instanceof Request ? input.url : String(input);
|
|
1605
|
-
const key = `GET:${url}\0${authTokenOf(input, init)}`;
|
|
1609
|
+
const key = `GET:${url}\0${authTokenOf(input, init)}\0${writes}`;
|
|
1606
1610
|
const existing = inFlightRequests.get(key);
|
|
1607
1611
|
if (existing) {
|
|
1608
1612
|
return existing.then((r) => r.clone());
|