serwist 10.0.0-preview.1 → 10.0.0-preview.2
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/NavigationRoute.d.ts.map +1 -1
- package/dist/RegExpRoute.d.ts.map +1 -1
- package/dist/Route.d.ts.map +1 -1
- package/dist/Serwist.d.ts +5 -5
- package/dist/Serwist.d.ts.map +1 -1
- package/dist/chunks/{resultingClientExists.js → waitUntil.js} +117 -117
- package/dist/copyResponse.d.ts.map +1 -1
- package/dist/index.d.ts +11 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.internal.d.ts +16 -16
- package/dist/index.internal.d.ts.map +1 -1
- package/dist/index.internal.js +2 -2
- package/dist/index.js +1400 -1387
- package/dist/lib/backgroundSync/StorableRequest.d.ts.map +1 -1
- package/dist/lib/backgroundSync/index.d.ts +6 -0
- package/dist/lib/backgroundSync/index.d.ts.map +1 -0
- package/dist/lib/broadcastUpdate/BroadcastCacheUpdate.d.ts.map +1 -1
- package/dist/lib/broadcastUpdate/index.d.ts +6 -0
- package/dist/lib/broadcastUpdate/index.d.ts.map +1 -0
- package/dist/lib/broadcastUpdate/responsesAreSame.d.ts.map +1 -1
- package/dist/lib/cacheableResponse/index.d.ts +4 -0
- package/dist/lib/cacheableResponse/index.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/PrecacheCacheKeyPlugin.d.ts +1 -1
- package/dist/lib/controllers/PrecacheController/PrecacheCacheKeyPlugin.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/PrecacheController.d.ts +9 -5
- package/dist/lib/controllers/PrecacheController/PrecacheController.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/PrecacheInstallReportPlugin.d.ts +1 -1
- package/dist/lib/controllers/PrecacheController/PrecacheInstallReportPlugin.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/PrecacheRoute.d.ts +1 -1
- package/dist/lib/controllers/PrecacheController/PrecacheRoute.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/PrecacheStrategy.d.ts +4 -4
- package/dist/lib/controllers/PrecacheController/PrecacheStrategy.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/PrecacheController/parsePrecacheOptions.d.ts +3 -3
- package/dist/lib/controllers/PrecacheController/parsePrecacheOptions.d.ts.map +1 -0
- package/dist/{controllers → lib/controllers}/RuntimeCacheController.d.ts +10 -5
- package/dist/lib/controllers/RuntimeCacheController.d.ts.map +1 -0
- package/dist/lib/controllers/index.d.ts +4 -0
- package/dist/lib/controllers/index.d.ts.map +1 -0
- package/dist/lib/expiration/ExpirationPlugin.d.ts.map +1 -1
- package/dist/lib/expiration/index.d.ts +4 -0
- package/dist/lib/expiration/index.d.ts.map +1 -0
- package/dist/lib/googleAnalytics/index.d.ts +3 -0
- package/dist/lib/googleAnalytics/index.d.ts.map +1 -0
- package/dist/lib/googleAnalytics/initializeGoogleAnalytics.d.ts.map +1 -1
- package/dist/lib/precaching/PrecacheFallbackPlugin.d.ts +12 -6
- package/dist/lib/precaching/PrecacheFallbackPlugin.d.ts.map +1 -1
- package/dist/lib/precaching/index.d.ts +3 -0
- package/dist/lib/precaching/index.d.ts.map +1 -0
- package/dist/lib/rangeRequests/createPartialResponse.d.ts.map +1 -1
- package/dist/lib/rangeRequests/index.d.ts +3 -0
- package/dist/lib/rangeRequests/index.d.ts.map +1 -0
- package/dist/lib/rangeRequests/utils/calculateEffectiveBoundaries.d.ts.map +1 -1
- package/dist/lib/rangeRequests/utils/parseRangeHeader.d.ts.map +1 -1
- package/dist/lib/strategies/Strategy.d.ts.map +1 -1
- package/dist/lib/strategies/StrategyHandler.d.ts.map +1 -1
- package/dist/lib/strategies/index.d.ts +11 -0
- package/dist/lib/strategies/index.d.ts.map +1 -0
- package/dist/navigationPreload.d.ts.map +1 -1
- package/dist/registerQuotaErrorCallback.d.ts.map +1 -1
- package/dist/setCacheNameDetails.d.ts +1 -1
- package/dist/setCacheNameDetails.d.ts.map +1 -1
- package/dist/types.d.ts +24 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/SerwistError.d.ts +1 -1
- package/dist/utils/SerwistError.d.ts.map +1 -1
- package/dist/utils/cleanupOutdatedCaches.d.ts.map +1 -1
- package/dist/utils/createCacheKey.d.ts.map +1 -1
- package/dist/utils/deleteOutdatedCaches.d.ts.map +1 -1
- package/dist/utils/getFriendlyURL.d.ts.map +1 -1
- package/dist/utils/normalizeHandler.d.ts.map +1 -1
- package/dist/utils/parseRoute.d.ts.map +1 -1
- package/dist/utils/printCleanupDetails.d.ts.map +1 -1
- package/dist/utils/printInstallDetails.d.ts.map +1 -1
- package/dist/utils/removeIgnoredSearchParams.d.ts.map +1 -1
- package/dist/utils/waitUntil.d.ts.map +1 -1
- package/package.json +28 -5
- package/src/NavigationRoute.ts +2 -2
- package/src/RegExpRoute.ts +2 -2
- package/src/Route.ts +2 -2
- package/src/Serwist.ts +23 -19
- package/src/cacheNames.ts +1 -1
- package/src/copyResponse.ts +2 -2
- package/src/index.internal.ts +16 -16
- package/src/index.ts +68 -96
- package/src/lib/backgroundSync/BackgroundSyncQueue.ts +4 -4
- package/src/lib/backgroundSync/BackgroundSyncQueueStore.ts +1 -1
- package/src/lib/backgroundSync/StorableRequest.ts +1 -1
- package/src/lib/backgroundSync/index.ts +5 -0
- package/src/lib/broadcastUpdate/BroadcastCacheUpdate.ts +4 -4
- package/src/lib/broadcastUpdate/index.ts +5 -0
- package/src/lib/broadcastUpdate/responsesAreSame.ts +2 -2
- package/src/lib/cacheableResponse/CacheableResponse.ts +4 -4
- package/src/lib/cacheableResponse/index.ts +3 -0
- package/src/{controllers → lib/controllers}/PrecacheController/PrecacheCacheKeyPlugin.ts +1 -1
- package/src/{controllers → lib/controllers}/PrecacheController/PrecacheController.ts +19 -16
- package/src/{controllers → lib/controllers}/PrecacheController/PrecacheInstallReportPlugin.ts +1 -1
- package/src/{controllers → lib/controllers}/PrecacheController/PrecacheRoute.ts +5 -5
- package/src/{controllers → lib/controllers}/PrecacheController/PrecacheStrategy.ts +10 -10
- package/src/{controllers → lib/controllers}/PrecacheController/parsePrecacheOptions.ts +3 -3
- package/src/{controllers → lib/controllers}/RuntimeCacheController.ts +6 -6
- package/src/lib/controllers/index.ts +3 -0
- package/src/lib/expiration/CacheExpiration.ts +3 -3
- package/src/lib/expiration/ExpirationPlugin.ts +6 -6
- package/src/lib/expiration/index.ts +3 -0
- package/src/lib/googleAnalytics/index.ts +2 -0
- package/src/lib/googleAnalytics/initializeGoogleAnalytics.ts +5 -5
- package/src/lib/precaching/PrecacheFallbackPlugin.ts +18 -7
- package/src/lib/precaching/index.ts +2 -0
- package/src/lib/rangeRequests/createPartialResponse.ts +3 -3
- package/src/lib/rangeRequests/index.ts +2 -0
- package/src/lib/rangeRequests/utils/calculateEffectiveBoundaries.ts +2 -2
- package/src/lib/rangeRequests/utils/parseRangeHeader.ts +2 -2
- package/src/lib/strategies/CacheFirst.ts +3 -3
- package/src/lib/strategies/CacheOnly.ts +3 -3
- package/src/lib/strategies/NetworkFirst.ts +3 -3
- package/src/lib/strategies/NetworkOnly.ts +4 -4
- package/src/lib/strategies/StaleWhileRevalidate.ts +3 -3
- package/src/lib/strategies/Strategy.ts +4 -4
- package/src/lib/strategies/StrategyHandler.ts +9 -9
- package/src/lib/strategies/index.ts +10 -0
- package/src/lib/strategies/utils/messages.ts +2 -2
- package/src/models/messages/messages.ts +3 -3
- package/src/navigationPreload.ts +1 -1
- package/src/registerQuotaErrorCallback.ts +2 -2
- package/src/setCacheNameDetails.ts +4 -4
- package/src/types.ts +36 -5
- package/src/utils/SerwistError.ts +2 -2
- package/src/utils/cacheNames.ts +1 -1
- package/src/utils/executeQuotaErrorCallbacks.ts +1 -1
- package/dist/controllers/PrecacheController/PrecacheCacheKeyPlugin.d.ts.map +0 -1
- package/dist/controllers/PrecacheController/PrecacheController.d.ts.map +0 -1
- package/dist/controllers/PrecacheController/PrecacheInstallReportPlugin.d.ts.map +0 -1
- package/dist/controllers/PrecacheController/PrecacheRoute.d.ts.map +0 -1
- package/dist/controllers/PrecacheController/PrecacheStrategy.d.ts.map +0 -1
- package/dist/controllers/PrecacheController/parsePrecacheOptions.d.ts.map +0 -1
- package/dist/controllers/RuntimeCacheController.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationRoute.d.ts","sourceRoot":"","sources":["../src/NavigationRoute.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavigationRoute.d.ts","sourceRoot":"","sources":["../src/NavigationRoute.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAA6B,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAW;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IAErC;;;;;;;;;;;;;;;;;OAiBG;gBACS,OAAO,EAAE,YAAY,EAAE,EAAE,SAAiB,EAAE,QAAa,EAAE,GAAE,2BAAgC;IAsBzG;;;;;;OAMG;IACH,OAAO,CAAC,MAAM;CA8Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegExpRoute.d.ts","sourceRoot":"","sources":["../src/RegExpRoute.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RegExpRoute.d.ts","sourceRoot":"","sources":["../src/RegExpRoute.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiD,MAAM,YAAY,CAAC;AAE9F;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,UAAU;CAyCvE"}
|
package/dist/Route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEvF;;;;;;GAMG;AACH,qBAAa,KAAK;IAChB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAElC;;;;;;;;;OASG;gBACS,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAE,UAA0B;IAqBhG;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;CAG7C"}
|
package/dist/Serwist.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { PrecacheController, type PrecacheOptions } from "#lib/controllers/PrecacheController/PrecacheController.js";
|
|
2
|
+
import { type GoogleAnalyticsInitializeOptions } from "#lib/googleAnalytics/initializeGoogleAnalytics.js";
|
|
3
|
+
import type { PrecacheFallbackEntry } from "#lib/precaching/PrecacheFallbackPlugin.js";
|
|
4
|
+
import type { Strategy } from "#lib/strategies/Strategy.js";
|
|
1
5
|
import type { Route } from "./Route.js";
|
|
2
6
|
import { type HTTPMethod } from "./constants.js";
|
|
3
|
-
import { type GoogleAnalyticsInitializeOptions } from "./lib/googleAnalytics/initializeGoogleAnalytics.js";
|
|
4
|
-
import type { PrecacheFallbackEntry } from "./lib/precaching/PrecacheFallbackPlugin.js";
|
|
5
|
-
import type { Strategy } from "./lib/strategies/Strategy.js";
|
|
6
7
|
import type { Controller, PrecacheEntry, RouteHandler, RouteHandlerCallback, RouteHandlerCallbackOptions, RouteMatchCallback, RouteMatchCallbackOptions, RuntimeCaching } from "./types.js";
|
|
7
|
-
import { PrecacheController, type PrecacheOptions } from "./controllers/PrecacheController/PrecacheController.js";
|
|
8
8
|
export interface FallbackEntry extends PrecacheFallbackEntry {
|
|
9
9
|
}
|
|
10
10
|
export interface FallbacksOptions {
|
|
@@ -235,7 +235,7 @@ export declare class Serwist {
|
|
|
235
235
|
/**
|
|
236
236
|
* Adds items to the precache list, removing duplicates and ensuring the information is valid.
|
|
237
237
|
*
|
|
238
|
-
* @deprecated Use `serwist.precache.
|
|
238
|
+
* @deprecated Use `serwist.precache.addToCacheList` instead.
|
|
239
239
|
* @param entries Array of entries to precache.
|
|
240
240
|
*/
|
|
241
241
|
addToPrecacheList(entries: (PrecacheEntry | string)[]): void;
|
package/dist/Serwist.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serwist.d.ts","sourceRoot":"","sources":["../src/Serwist.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Serwist.d.ts","sourceRoot":"","sources":["../src/Serwist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAErH,OAAO,EAAE,KAAK,gCAAgC,EAA6B,MAAM,mDAAmD,CAAC;AACrI,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MA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AAC,QAAQ,GAAG,SAAS,CAAC;IAIvE;;;;;;;OAOG;IACH,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB;CAG3D"}
|
|
@@ -35,13 +35,13 @@ const messages = {
|
|
|
35
35
|
return `${moduleName}.${className}.${funcName}() expected the ` + `'${paramName}' parameter to expose a '${expectedMethod}' method.`;
|
|
36
36
|
},
|
|
37
37
|
"add-to-cache-list-unexpected-type": ({ entry })=>{
|
|
38
|
-
return `An unexpected entry was passed to 'serwist.Serwist.
|
|
38
|
+
return `An unexpected entry was passed to 'serwist.Serwist.precache.addToCacheList()' The entry '${JSON.stringify(entry)}' isn't supported. You must supply an array of strings with one or more characters, objects with a url property or Request objects.`;
|
|
39
39
|
},
|
|
40
40
|
"add-to-cache-list-conflicting-entries": ({ firstEntry, secondEntry })=>{
|
|
41
41
|
if (!firstEntry || !secondEntry) {
|
|
42
42
|
throw new Error("Unexpected input to " + `'add-to-cache-list-duplicate-entries' error.`);
|
|
43
43
|
}
|
|
44
|
-
return `Two of the entries passed to 'serwist.Serwist.
|
|
44
|
+
return `Two of the entries passed to 'serwist.Serwist.precache.addToCacheList()' had the URL ${firstEntry} but different revision details. Serwist is unable to cache and version the asset correctly. Please remove one of the entries.`;
|
|
45
45
|
},
|
|
46
46
|
"plugin-error-request-will-fetch": ({ thrownErrorMessage })=>{
|
|
47
47
|
if (!thrownErrorMessage) {
|
|
@@ -144,7 +144,7 @@ const messages = {
|
|
|
144
144
|
return `'createHandlerBoundToURL("${url}")' was called, but that URL is not precached. Please pass in a URL that is precached instead.`;
|
|
145
145
|
},
|
|
146
146
|
"add-to-cache-list-conflicting-integrities": ({ url })=>{
|
|
147
|
-
return `Two of the entries passed to 'serwist.Serwist.
|
|
147
|
+
return `Two of the entries passed to 'serwist.Serwist.precache.addToCacheList()' had the URL ${url} with different integrity values. Please remove one of them.`;
|
|
148
148
|
},
|
|
149
149
|
"missing-precache-entry": ({ cacheName, url })=>{
|
|
150
150
|
return `Unable to find a precached response in ${cacheName} for ${url}.`;
|
|
@@ -187,71 +187,54 @@ class SerwistError extends Error {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const testResponse = new Response("");
|
|
194
|
-
if ("body" in testResponse) {
|
|
195
|
-
try {
|
|
196
|
-
new Response(testResponse.body);
|
|
197
|
-
supportStatus = true;
|
|
198
|
-
} catch (error) {
|
|
199
|
-
supportStatus = false;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
supportStatus = false;
|
|
190
|
+
const isArray = (value, details)=>{
|
|
191
|
+
if (!Array.isArray(value)) {
|
|
192
|
+
throw new SerwistError("not-an-array", details);
|
|
203
193
|
}
|
|
204
|
-
return supportStatus;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const _cacheNameDetails = {
|
|
208
|
-
googleAnalytics: "googleAnalytics",
|
|
209
|
-
precache: "precache-v2",
|
|
210
|
-
prefix: "serwist",
|
|
211
|
-
runtime: "runtime",
|
|
212
|
-
suffix: typeof registration !== "undefined" ? registration.scope : ""
|
|
213
194
|
};
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
195
|
+
const hasMethod = (object, expectedMethod, details)=>{
|
|
196
|
+
const type = typeof object[expectedMethod];
|
|
197
|
+
if (type !== "function") {
|
|
198
|
+
details.expectedMethod = expectedMethod;
|
|
199
|
+
throw new SerwistError("missing-a-method", details);
|
|
200
|
+
}
|
|
220
201
|
};
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
202
|
+
const isType = (object, expectedType, details)=>{
|
|
203
|
+
if (typeof object !== expectedType) {
|
|
204
|
+
details.expectedType = expectedType;
|
|
205
|
+
throw new SerwistError("incorrect-type", details);
|
|
224
206
|
}
|
|
225
207
|
};
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (typeof detail === "string") {
|
|
231
|
-
_cacheNameDetails[key] = detail;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
},
|
|
235
|
-
getGoogleAnalyticsName: (userCacheName)=>{
|
|
236
|
-
return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
|
|
237
|
-
},
|
|
238
|
-
getPrecacheName: (userCacheName)=>{
|
|
239
|
-
return userCacheName || _createCacheName(_cacheNameDetails.precache);
|
|
240
|
-
},
|
|
241
|
-
getPrefix: ()=>{
|
|
242
|
-
return _cacheNameDetails.prefix;
|
|
243
|
-
},
|
|
244
|
-
getRuntimeName: (userCacheName)=>{
|
|
245
|
-
return userCacheName || _createCacheName(_cacheNameDetails.runtime);
|
|
246
|
-
},
|
|
247
|
-
getSuffix: ()=>{
|
|
248
|
-
return _cacheNameDetails.suffix;
|
|
208
|
+
const isInstance = (object, expectedClass, details)=>{
|
|
209
|
+
if (!(object instanceof expectedClass)) {
|
|
210
|
+
details.expectedClassName = expectedClass.name;
|
|
211
|
+
throw new SerwistError("incorrect-class", details);
|
|
249
212
|
}
|
|
250
213
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
214
|
+
const isOneOf = (value, validValues, details)=>{
|
|
215
|
+
if (!validValues.includes(value)) {
|
|
216
|
+
details.validValueDescription = `Valid values are ${JSON.stringify(validValues)}.`;
|
|
217
|
+
throw new SerwistError("invalid-value", details);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const isArrayOfClass = (value, expectedClass, details)=>{
|
|
221
|
+
const error = new SerwistError("not-array-of-class", details);
|
|
222
|
+
if (!Array.isArray(value)) {
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
for (const item of value){
|
|
226
|
+
if (!(item instanceof expectedClass)) {
|
|
227
|
+
throw error;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const finalAssertExports = process.env.NODE_ENV === "production" ? null : {
|
|
232
|
+
hasMethod,
|
|
233
|
+
isArray,
|
|
234
|
+
isInstance,
|
|
235
|
+
isOneOf,
|
|
236
|
+
isType,
|
|
237
|
+
isArrayOfClass
|
|
255
238
|
};
|
|
256
239
|
|
|
257
240
|
const logger = process.env.NODE_ENV === "production" ? null : (()=>{
|
|
@@ -305,6 +288,73 @@ const logger = process.env.NODE_ENV === "production" ? null : (()=>{
|
|
|
305
288
|
}, {});
|
|
306
289
|
})();
|
|
307
290
|
|
|
291
|
+
const getFriendlyURL = (url)=>{
|
|
292
|
+
const urlObj = new URL(String(url), location.href);
|
|
293
|
+
return urlObj.href.replace(new RegExp(`^${location.origin}`), "");
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const _cacheNameDetails = {
|
|
297
|
+
googleAnalytics: "googleAnalytics",
|
|
298
|
+
precache: "precache-v2",
|
|
299
|
+
prefix: "serwist",
|
|
300
|
+
runtime: "runtime",
|
|
301
|
+
suffix: typeof registration !== "undefined" ? registration.scope : ""
|
|
302
|
+
};
|
|
303
|
+
const _createCacheName = (cacheName)=>{
|
|
304
|
+
return [
|
|
305
|
+
_cacheNameDetails.prefix,
|
|
306
|
+
cacheName,
|
|
307
|
+
_cacheNameDetails.suffix
|
|
308
|
+
].filter((value)=>value && value.length > 0).join("-");
|
|
309
|
+
};
|
|
310
|
+
const eachCacheNameDetail = (fn)=>{
|
|
311
|
+
for (const key of Object.keys(_cacheNameDetails)){
|
|
312
|
+
fn(key);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const cacheNames = {
|
|
316
|
+
updateDetails: (details)=>{
|
|
317
|
+
eachCacheNameDetail((key)=>{
|
|
318
|
+
const detail = details[key];
|
|
319
|
+
if (typeof detail === "string") {
|
|
320
|
+
_cacheNameDetails[key] = detail;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
getGoogleAnalyticsName: (userCacheName)=>{
|
|
325
|
+
return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
|
|
326
|
+
},
|
|
327
|
+
getPrecacheName: (userCacheName)=>{
|
|
328
|
+
return userCacheName || _createCacheName(_cacheNameDetails.precache);
|
|
329
|
+
},
|
|
330
|
+
getPrefix: ()=>{
|
|
331
|
+
return _cacheNameDetails.prefix;
|
|
332
|
+
},
|
|
333
|
+
getRuntimeName: (userCacheName)=>{
|
|
334
|
+
return userCacheName || _createCacheName(_cacheNameDetails.runtime);
|
|
335
|
+
},
|
|
336
|
+
getSuffix: ()=>{
|
|
337
|
+
return _cacheNameDetails.suffix;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
let supportStatus;
|
|
342
|
+
function canConstructResponseFromBodyStream() {
|
|
343
|
+
if (supportStatus === undefined) {
|
|
344
|
+
const testResponse = new Response("");
|
|
345
|
+
if ("body" in testResponse) {
|
|
346
|
+
try {
|
|
347
|
+
new Response(testResponse.body);
|
|
348
|
+
supportStatus = true;
|
|
349
|
+
} catch (error) {
|
|
350
|
+
supportStatus = false;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
supportStatus = false;
|
|
354
|
+
}
|
|
355
|
+
return supportStatus;
|
|
356
|
+
}
|
|
357
|
+
|
|
308
358
|
class Deferred {
|
|
309
359
|
promise;
|
|
310
360
|
resolve;
|
|
@@ -317,56 +367,6 @@ class Deferred {
|
|
|
317
367
|
}
|
|
318
368
|
}
|
|
319
369
|
|
|
320
|
-
const isArray = (value, details)=>{
|
|
321
|
-
if (!Array.isArray(value)) {
|
|
322
|
-
throw new SerwistError("not-an-array", details);
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
const hasMethod = (object, expectedMethod, details)=>{
|
|
326
|
-
const type = typeof object[expectedMethod];
|
|
327
|
-
if (type !== "function") {
|
|
328
|
-
details.expectedMethod = expectedMethod;
|
|
329
|
-
throw new SerwistError("missing-a-method", details);
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
const isType = (object, expectedType, details)=>{
|
|
333
|
-
if (typeof object !== expectedType) {
|
|
334
|
-
details.expectedType = expectedType;
|
|
335
|
-
throw new SerwistError("incorrect-type", details);
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
const isInstance = (object, expectedClass, details)=>{
|
|
339
|
-
if (!(object instanceof expectedClass)) {
|
|
340
|
-
details.expectedClassName = expectedClass.name;
|
|
341
|
-
throw new SerwistError("incorrect-class", details);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
const isOneOf = (value, validValues, details)=>{
|
|
345
|
-
if (!validValues.includes(value)) {
|
|
346
|
-
details.validValueDescription = `Valid values are ${JSON.stringify(validValues)}.`;
|
|
347
|
-
throw new SerwistError("invalid-value", details);
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
const isArrayOfClass = (value, expectedClass, details)=>{
|
|
351
|
-
const error = new SerwistError("not-array-of-class", details);
|
|
352
|
-
if (!Array.isArray(value)) {
|
|
353
|
-
throw error;
|
|
354
|
-
}
|
|
355
|
-
for (const item of value){
|
|
356
|
-
if (!(item instanceof expectedClass)) {
|
|
357
|
-
throw error;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
const finalAssertExports = process.env.NODE_ENV === "production" ? null : {
|
|
362
|
-
hasMethod,
|
|
363
|
-
isArray,
|
|
364
|
-
isInstance,
|
|
365
|
-
isOneOf,
|
|
366
|
-
isType,
|
|
367
|
-
isArrayOfClass
|
|
368
|
-
};
|
|
369
|
-
|
|
370
370
|
function stripParams(fullURL, ignoreParams) {
|
|
371
371
|
const strippedURL = new URL(fullURL);
|
|
372
372
|
for (const param of ignoreParams){
|
|
@@ -418,12 +418,6 @@ const clientsClaim = ()=>{
|
|
|
418
418
|
self.addEventListener("activate", ()=>self.clients.claim());
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
const waitUntil = (event, asyncFn)=>{
|
|
422
|
-
const returnPromise = asyncFn();
|
|
423
|
-
event.waitUntil(returnPromise);
|
|
424
|
-
return returnPromise;
|
|
425
|
-
};
|
|
426
|
-
|
|
427
421
|
const MAX_RETRY_TIME = 2000;
|
|
428
422
|
async function resultingClientExists(resultingClientId) {
|
|
429
423
|
if (!resultingClientId) {
|
|
@@ -453,4 +447,10 @@ async function resultingClientExists(resultingClientId) {
|
|
|
453
447
|
return resultingWindow;
|
|
454
448
|
}
|
|
455
449
|
|
|
450
|
+
const waitUntil = (event, asyncFn)=>{
|
|
451
|
+
const returnPromise = asyncFn();
|
|
452
|
+
event.waitUntil(returnPromise);
|
|
453
|
+
return returnPromise;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
456
|
export { Deferred as D, SerwistError as S, cacheMatchIgnoreParams as a, cacheNames as b, canConstructResponseFromBodyStream as c, clientsClaim as d, executeQuotaErrorCallbacks as e, finalAssertExports as f, getFriendlyURL as g, logger as l, quotaErrorCallbacks as q, resultingClientExists as r, timeout as t, waitUntil as w };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyResponse.d.ts","sourceRoot":"","sources":["../src/copyResponse.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"copyResponse.d.ts","sourceRoot":"","sources":["../src/copyResponse.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,GAAU,UAAU,QAAQ,EAAE,WAAW,CAAC,YAAY,EAAE,YAAY,KAAK,YAAY,KAAG,OAAO,CAAC,QAAQ,CA8BhI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { PrecacheStrategy } from "./controllers/PrecacheController/PrecacheStrategy.js";
|
|
2
|
-
import { PrecacheRoute } from "./controllers/PrecacheController/PrecacheRoute.js";
|
|
3
|
-
import { RuntimeCacheController } from "./controllers/RuntimeCacheController.js";
|
|
4
1
|
import type { NavigationRouteMatchOptions } from "./NavigationRoute.js";
|
|
5
2
|
import { NavigationRoute } from "./NavigationRoute.js";
|
|
6
3
|
import { RegExpRoute } from "./RegExpRoute.js";
|
|
@@ -10,42 +7,19 @@ import { cacheNames } from "./cacheNames.js";
|
|
|
10
7
|
import type { HTTPMethod } from "./constants.js";
|
|
11
8
|
import { copyResponse } from "./copyResponse.js";
|
|
12
9
|
import { disableDevLogs } from "./disableDevLogs.js";
|
|
13
|
-
import { BackgroundSyncPlugin } from "./lib/backgroundSync/BackgroundSyncPlugin.js";
|
|
14
|
-
import type { BackgroundSyncQueueEntry, BackgroundSyncQueueOptions } from "./lib/backgroundSync/BackgroundSyncQueue.js";
|
|
15
|
-
import { BackgroundSyncQueue } from "./lib/backgroundSync/BackgroundSyncQueue.js";
|
|
16
|
-
import { BackgroundSyncQueueStore } from "./lib/backgroundSync/BackgroundSyncQueueStore.js";
|
|
17
|
-
import { StorableRequest } from "./lib/backgroundSync/StorableRequest.js";
|
|
18
|
-
import { BroadcastCacheUpdate } from "./lib/broadcastUpdate/BroadcastCacheUpdate.js";
|
|
19
|
-
import { BroadcastUpdatePlugin } from "./lib/broadcastUpdate/BroadcastUpdatePlugin.js";
|
|
20
|
-
import { BROADCAST_UPDATE_DEFAULT_HEADERS } from "./lib/broadcastUpdate/constants.js";
|
|
21
|
-
import { responsesAreSame } from "./lib/broadcastUpdate/responsesAreSame.js";
|
|
22
|
-
import type { BroadcastCacheUpdateOptions, BroadcastMessage, BroadcastPayload, BroadcastPayloadGenerator } from "./lib/broadcastUpdate/types.js";
|
|
23
|
-
import { CacheableResponse } from "./lib/cacheableResponse/CacheableResponse.js";
|
|
24
|
-
import type { CacheableResponseOptions } from "./lib/cacheableResponse/CacheableResponse.js";
|
|
25
|
-
import { CacheableResponsePlugin } from "./lib/cacheableResponse/CacheableResponsePlugin.js";
|
|
26
|
-
import { CacheExpiration } from "./lib/expiration/CacheExpiration.js";
|
|
27
|
-
import type { ExpirationPluginOptions } from "./lib/expiration/ExpirationPlugin.js";
|
|
28
|
-
import { ExpirationPlugin } from "./lib/expiration/ExpirationPlugin.js";
|
|
29
|
-
import { initializeGoogleAnalytics } from "./lib/googleAnalytics/initializeGoogleAnalytics.js";
|
|
30
|
-
import type { GoogleAnalyticsInitializeOptions } from "./lib/googleAnalytics/initializeGoogleAnalytics.js";
|
|
31
|
-
import type { PrecacheFallbackEntry, PrecacheFallbackPluginOptions } from "./lib/precaching/PrecacheFallbackPlugin.js";
|
|
32
|
-
import { PrecacheFallbackPlugin } from "./lib/precaching/PrecacheFallbackPlugin.js";
|
|
33
|
-
import { RangeRequestsPlugin } from "./lib/rangeRequests/RangeRequestsPlugin.js";
|
|
34
|
-
import { createPartialResponse } from "./lib/rangeRequests/createPartialResponse.js";
|
|
35
|
-
import { CacheFirst } from "./lib/strategies/CacheFirst.js";
|
|
36
|
-
import { CacheOnly } from "./lib/strategies/CacheOnly.js";
|
|
37
|
-
import type { NetworkFirstOptions } from "./lib/strategies/NetworkFirst.js";
|
|
38
|
-
import { NetworkFirst } from "./lib/strategies/NetworkFirst.js";
|
|
39
|
-
import type { NetworkOnlyOptions } from "./lib/strategies/NetworkOnly.js";
|
|
40
|
-
import { NetworkOnly } from "./lib/strategies/NetworkOnly.js";
|
|
41
|
-
import { StaleWhileRevalidate } from "./lib/strategies/StaleWhileRevalidate.js";
|
|
42
|
-
import type { StrategyOptions } from "./lib/strategies/Strategy.js";
|
|
43
|
-
import { Strategy } from "./lib/strategies/Strategy.js";
|
|
44
|
-
import { StrategyHandler } from "./lib/strategies/StrategyHandler.js";
|
|
45
10
|
import { disableNavigationPreload, enableNavigationPreload, isNavigationPreloadSupported } from "./navigationPreload.js";
|
|
46
11
|
import { registerQuotaErrorCallback } from "./registerQuotaErrorCallback.js";
|
|
47
12
|
import { setCacheNameDetails } from "./setCacheNameDetails.js";
|
|
48
|
-
export {
|
|
49
|
-
export
|
|
13
|
+
export { BackgroundSyncPlugin, BackgroundSyncQueue, BackgroundSyncQueueStore, StorableRequest, type BackgroundSyncQueueOptions, type BackgroundSyncQueueEntry, } from "#lib/backgroundSync/index.js";
|
|
14
|
+
export { BroadcastCacheUpdate, BroadcastUpdatePlugin, BROADCAST_UPDATE_DEFAULT_HEADERS, responsesAreSame, type BroadcastCacheUpdateOptions, type BroadcastPayload, type BroadcastPayloadGenerator, type BroadcastMessage, } from "#lib/broadcastUpdate/index.js";
|
|
15
|
+
export { CacheableResponse, CacheableResponsePlugin, type CacheableResponseOptions, } from "#lib/cacheableResponse/index.js";
|
|
16
|
+
export { PrecacheStrategy, PrecacheRoute, RuntimeCacheController } from "#lib/controllers/index.js";
|
|
17
|
+
export { CacheExpiration, ExpirationPlugin, type ExpirationPluginOptions, } from "#lib/expiration/index.js";
|
|
18
|
+
export { initializeGoogleAnalytics, type GoogleAnalyticsInitializeOptions } from "#lib/googleAnalytics/index.js";
|
|
19
|
+
export { PrecacheFallbackPlugin, type PrecacheFallbackEntry, type PrecacheFallbackPluginOptions, } from "#lib/precaching/index.js";
|
|
20
|
+
export { createPartialResponse, RangeRequestsPlugin, } from "#lib/rangeRequests/index.js";
|
|
21
|
+
export { CacheFirst, CacheOnly, NetworkFirst, NetworkOnly, StaleWhileRevalidate, Strategy, StrategyHandler, type NetworkFirstOptions, type NetworkOnlyOptions, type StrategyOptions, } from "#lib/strategies/index.js";
|
|
22
|
+
export { Serwist, cacheNames, copyResponse, disableDevLogs, disableNavigationPreload, enableNavigationPreload, isNavigationPreloadSupported, registerQuotaErrorCallback, setCacheNameDetails, NavigationRoute, RegExpRoute, Route, };
|
|
23
|
+
export type { HTTPMethod, SerwistOptions, NavigationRouteMatchOptions };
|
|
50
24
|
export type * from "./types.js";
|
|
51
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[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,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,yBAAyB,EAAE,KAAK,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAGjH,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,GACnC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,QAAQ,EACR,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EAEnB,eAAe,EACf,WAAW,EACX,KAAK,GACN,CAAC;AACF,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,2BAA2B,EAAE,CAAC;AACxE,mBAAmB,YAAY,CAAC"}
|
package/dist/index.internal.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Deferred } from "
|
|
2
|
-
import { SerwistError } from "
|
|
3
|
-
import { assert } from "
|
|
4
|
-
import { cacheMatchIgnoreParams } from "
|
|
5
|
-
import { cacheNames as privateCacheNames } from "
|
|
6
|
-
import { canConstructReadableStream } from "
|
|
7
|
-
import { canConstructResponseFromBodyStream } from "
|
|
8
|
-
import { cleanupOutdatedCaches } from "
|
|
9
|
-
import { clientsClaim } from "
|
|
10
|
-
import { dontWaitFor } from "
|
|
11
|
-
import { executeQuotaErrorCallbacks } from "
|
|
12
|
-
import { getFriendlyURL } from "
|
|
13
|
-
import { logger } from "
|
|
14
|
-
import { resultingClientExists } from "
|
|
15
|
-
import { timeout } from "
|
|
16
|
-
import { waitUntil } from "
|
|
1
|
+
import { Deferred } from "#utils/Deferred.js";
|
|
2
|
+
import { SerwistError } from "#utils/SerwistError.js";
|
|
3
|
+
import { assert } from "#utils/assert.js";
|
|
4
|
+
import { cacheMatchIgnoreParams } from "#utils/cacheMatchIgnoreParams.js";
|
|
5
|
+
import { cacheNames as privateCacheNames } from "#utils/cacheNames.js";
|
|
6
|
+
import { canConstructReadableStream } from "#utils/canConstructReadableStream.js";
|
|
7
|
+
import { canConstructResponseFromBodyStream } from "#utils/canConstructResponseFromBodyStream.js";
|
|
8
|
+
import { cleanupOutdatedCaches } from "#utils/cleanupOutdatedCaches.js";
|
|
9
|
+
import { clientsClaim } from "#utils/clientsClaim.js";
|
|
10
|
+
import { dontWaitFor } from "#utils/dontWaitFor.js";
|
|
11
|
+
import { executeQuotaErrorCallbacks } from "#utils/executeQuotaErrorCallbacks.js";
|
|
12
|
+
import { getFriendlyURL } from "#utils/getFriendlyURL.js";
|
|
13
|
+
import { logger } from "#utils/logger.js";
|
|
14
|
+
import { resultingClientExists } from "#utils/resultingClientExists.js";
|
|
15
|
+
import { timeout } from "#utils/timeout.js";
|
|
16
|
+
import { waitUntil } from "#utils/waitUntil.js";
|
|
17
17
|
export { Deferred, SerwistError, assert, cleanupOutdatedCaches, clientsClaim, cacheMatchIgnoreParams, privateCacheNames, canConstructReadableStream, canConstructResponseFromBodyStream, dontWaitFor, executeQuotaErrorCallbacks, getFriendlyURL, logger, resultingClientExists, timeout, waitUntil, };
|
|
18
18
|
//# sourceMappingURL=index.internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,0BAA0B,EAC1B,kCAAkC,EAClC,WAAW,EACX,0BAA0B,EAC1B,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,OAAO,EACP,SAAS,GACV,CAAC"}
|
package/dist/index.internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as cacheNames, l as logger } from './chunks/
|
|
2
|
-
export { D as Deferred, S as SerwistError, f as assert, a as cacheMatchIgnoreParams, c as canConstructResponseFromBodyStream, d as clientsClaim, e as executeQuotaErrorCallbacks, g as getFriendlyURL, r as resultingClientExists, t as timeout, w as waitUntil } from './chunks/
|
|
1
|
+
import { b as cacheNames, l as logger } from './chunks/waitUntil.js';
|
|
2
|
+
export { D as Deferred, S as SerwistError, f as assert, a as cacheMatchIgnoreParams, c as canConstructResponseFromBodyStream, d as clientsClaim, e as executeQuotaErrorCallbacks, g as getFriendlyURL, r as resultingClientExists, t as timeout, w as waitUntil } from './chunks/waitUntil.js';
|
|
3
3
|
|
|
4
4
|
let supportStatus;
|
|
5
5
|
function canConstructReadableStream() {
|