@serwist/recipes 9.0.0-preview.5 → 9.0.0-preview.7

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.
@@ -30,6 +30,5 @@ export interface ImageCacheOptions {
30
30
  *
31
31
  * @param options
32
32
  */
33
- declare function imageCache(options?: ImageCacheOptions): void;
34
- export { imageCache };
33
+ export declare const imageCache: (options?: ImageCacheOptions) => void;
35
34
  //# sourceMappingURL=imageCache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageCache.d.ts","sourceRoot":"","sources":["../src/imageCache.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAA6B,aAAa,EAAE,MAAM,eAAe,CAAC;AAOlG,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,IAAI,CA+BzD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"imageCache.d.ts","sourceRoot":"","sources":["../src/imageCache.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAA6B,aAAa,EAAE,MAAM,eAAe,CAAC;AAOlG,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAAa,iBAAiB,KAAQ,IA+B5D,CAAC"}
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ function warmStrategyCache(options) {
39
39
  });
40
40
  }
41
41
 
42
- function imageCache(options = {}) {
42
+ const imageCache = (options = {})=>{
43
43
  const defaultMatchCallback = ({ request })=>request.destination === "image";
44
44
  const cacheName = options.cacheName || "images";
45
45
  const matchCallback = options.matchCallback || defaultMatchCallback;
@@ -67,7 +67,7 @@ function imageCache(options = {}) {
67
67
  strategy
68
68
  });
69
69
  }
70
- }
70
+ };
71
71
 
72
72
  function offlineFallback(options = {}) {
73
73
  const pageFallback = options.pageFallback || "offline.html";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/recipes",
3
- "version": "9.0.0-preview.5",
3
+ "version": "9.0.0-preview.7",
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.5",
34
- "@serwist/core": "9.0.0-preview.5",
35
- "@serwist/expiration": "9.0.0-preview.5",
36
- "@serwist/precaching": "9.0.0-preview.5",
37
- "@serwist/routing": "9.0.0-preview.5",
38
- "@serwist/strategies": "9.0.0-preview.5"
33
+ "@serwist/cacheable-response": "9.0.0-preview.7",
34
+ "@serwist/core": "9.0.0-preview.7",
35
+ "@serwist/expiration": "9.0.0-preview.7",
36
+ "@serwist/precaching": "9.0.0-preview.7",
37
+ "@serwist/routing": "9.0.0-preview.7",
38
+ "@serwist/strategies": "9.0.0-preview.7"
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.5"
43
+ "@serwist/constants": "9.0.0-preview.7"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "typescript": ">=5.0.0"
package/src/imageCache.ts CHANGED
@@ -46,7 +46,7 @@ export interface ImageCacheOptions {
46
46
  *
47
47
  * @param options
48
48
  */
49
- function imageCache(options: ImageCacheOptions = {}): void {
49
+ export const imageCache = (options: ImageCacheOptions = {}): void => {
50
50
  const defaultMatchCallback = ({ request }: RouteMatchCallbackOptions) => request.destination === "image";
51
51
 
52
52
  const cacheName = options.cacheName || "images";
@@ -77,6 +77,4 @@ function imageCache(options: ImageCacheOptions = {}): void {
77
77
  if (options.warmCache) {
78
78
  warmStrategyCache({ urls: options.warmCache, strategy });
79
79
  }
80
- }
81
-
82
- export { imageCache };
80
+ };