@serwist/recipes 9.0.0-preview.7 → 9.0.0-preview.9
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.js
CHANGED
@@ -69,7 +69,7 @@ const imageCache = (options = {})=>{
|
|
69
69
|
}
|
70
70
|
};
|
71
71
|
|
72
|
-
|
72
|
+
const offlineFallback = (options = {})=>{
|
73
73
|
const pageFallback = options.pageFallback || "offline.html";
|
74
74
|
const imageFallback = options.imageFallback || false;
|
75
75
|
const fontFallback = options.fontFallback || false;
|
@@ -103,7 +103,7 @@ function offlineFallback(options = {}) {
|
|
103
103
|
return Response.error();
|
104
104
|
};
|
105
105
|
setCatchHandler(handler);
|
106
|
-
}
|
106
|
+
};
|
107
107
|
|
108
108
|
function pageCache(options = {}) {
|
109
109
|
const defaultMatchCallback = ({ request })=>request.mode === "navigate";
|
@@ -18,6 +18,5 @@ export interface OfflineFallbackOptions {
|
|
18
18
|
|
19
19
|
* @param options
|
20
20
|
*/
|
21
|
-
declare
|
22
|
-
export { offlineFallback };
|
21
|
+
export declare const offlineFallback: (options?: OfflineFallbackOptions) => void;
|
23
22
|
//# sourceMappingURL=offlineFallback.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"offlineFallback.d.ts","sourceRoot":"","sources":["../src/offlineFallback.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD;;;;;GAKG;AACH,
|
1
|
+
{"version":3,"file":"offlineFallback.d.ts","sourceRoot":"","sources":["../src/offlineFallback.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,aAAa,sBAAsB,KAAQ,IAwCtE,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@serwist/recipes",
|
3
|
-
"version": "9.0.0-preview.
|
3
|
+
"version": "9.0.0-preview.9",
|
4
4
|
"type": "module",
|
5
5
|
"description": "A service worker helper library to manage common request and caching patterns",
|
6
6
|
"files": [
|
@@ -30,17 +30,17 @@
|
|
30
30
|
"./package.json": "./package.json"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@serwist/cacheable-response": "9.0.0-preview.
|
34
|
-
"@serwist/core": "9.0.0-preview.
|
35
|
-
"@serwist/expiration": "9.0.0-preview.
|
36
|
-
"@serwist/precaching": "9.0.0-preview.
|
37
|
-
"@serwist/routing": "9.0.0-preview.
|
38
|
-
"@serwist/strategies": "9.0.0-preview.
|
33
|
+
"@serwist/cacheable-response": "9.0.0-preview.9",
|
34
|
+
"@serwist/core": "9.0.0-preview.9",
|
35
|
+
"@serwist/expiration": "9.0.0-preview.9",
|
36
|
+
"@serwist/precaching": "9.0.0-preview.9",
|
37
|
+
"@serwist/routing": "9.0.0-preview.9",
|
38
|
+
"@serwist/strategies": "9.0.0-preview.9"
|
39
39
|
},
|
40
40
|
"devDependencies": {
|
41
41
|
"rollup": "4.9.6",
|
42
42
|
"typescript": "5.4.0-dev.20240206",
|
43
|
-
"@serwist/constants": "9.0.0-preview.
|
43
|
+
"@serwist/constants": "9.0.0-preview.9"
|
44
44
|
},
|
45
45
|
"peerDependencies": {
|
46
46
|
"typescript": ">=5.0.0"
|
package/src/offlineFallback.ts
CHANGED
@@ -34,7 +34,7 @@ declare let self: ServiceWorkerGlobalScope;
|
|
34
34
|
|
35
35
|
* @param options
|
36
36
|
*/
|
37
|
-
|
37
|
+
export const offlineFallback = (options: OfflineFallbackOptions = {}): void => {
|
38
38
|
const pageFallback = options.pageFallback || "offline.html";
|
39
39
|
const imageFallback = options.imageFallback || false;
|
40
40
|
const fontFallback = options.fontFallback || false;
|
@@ -74,6 +74,4 @@ function offlineFallback(options: OfflineFallbackOptions = {}): void {
|
|
74
74
|
};
|
75
75
|
|
76
76
|
setCatchHandler(handler);
|
77
|
-
}
|
78
|
-
|
79
|
-
export { offlineFallback };
|
77
|
+
};
|