@serwist/navigation-preload 9.0.0-preview.10 → 9.0.0-preview.11

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/disable.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * If the browser supports Navigation Preload, then this will disable it.
2
+ * If the browser supports navigation preloading, then this will disable it.
3
3
  */
4
4
  export declare const disable: () => void;
5
5
  //# sourceMappingURL=disable.d.ts.map
package/dist/enable.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  /**
2
- * If the browser supports Navigation Preload, then this will enable it.
2
+ * If the browser supports navigation preloading, then this will enable it.
3
3
  *
4
- * @param headerValue Optionally, allows developers to
5
- * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
6
- * the value of the `Service-Worker-Navigation-Preload` header which will be
7
- * sent to the server when making the navigation request.
4
+ * @param headerValue Optional. Allows developers to override the value of
5
+ * the `Service-Worker-Navigation-Preload` header which will be sent to the
6
+ * server when making the navigation request.
8
7
  */
9
8
  export declare const enable: (headerValue?: string) => void;
10
9
  //# sourceMappingURL=enable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../src/enable.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,iBAAkB,MAAM,KAAG,IAqB7C,CAAC"}
1
+ {"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../src/enable.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,iBAAkB,MAAM,KAAG,IAqB7C,CAAC"}
@@ -1,6 +1,8 @@
1
1
  /**
2
- * @returns Whether or not the current browser supports enabling
3
- * navigation preload.
2
+ * Checks whether the current browser supports
3
+ * navigation preloading.
4
+ *
5
+ * @returns
4
6
  */
5
7
  export declare const isSupported: () => boolean;
6
8
  //# sourceMappingURL=isSupported.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isSupported.d.ts","sourceRoot":"","sources":["../src/isSupported.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAO,OAE9B,CAAC"}
1
+ {"version":3,"file":"isSupported.d.ts","sourceRoot":"","sources":["../src/isSupported.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAO,OAE9B,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@serwist/navigation-preload",
3
- "version": "9.0.0-preview.10",
3
+ "version": "9.0.0-preview.11",
4
4
  "type": "module",
5
- "description": "This library allows developers to opt-in to using Navigation Preload in their service worker.",
5
+ "description": "A module that allows developers to enable navigation preloading in their service worker.",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -29,12 +29,12 @@
29
29
  "./package.json": "./package.json"
30
30
  },
31
31
  "dependencies": {
32
- "@serwist/core": "9.0.0-preview.10"
32
+ "@serwist/core": "9.0.0-preview.11"
33
33
  },
34
34
  "devDependencies": {
35
35
  "rollup": "4.9.6",
36
36
  "typescript": "5.4.0-dev.20240206",
37
- "@serwist/constants": "9.0.0-preview.10"
37
+ "@serwist/constants": "9.0.0-preview.11"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "typescript": ">=5.0.0"
package/src/disable.ts CHANGED
@@ -14,7 +14,7 @@ import { isSupported } from "./isSupported.js";
14
14
  declare let self: ServiceWorkerGlobalScope;
15
15
 
16
16
  /**
17
- * If the browser supports Navigation Preload, then this will disable it.
17
+ * If the browser supports navigation preloading, then this will disable it.
18
18
  */
19
19
  export const disable = (): void => {
20
20
  if (isSupported()) {
package/src/enable.ts CHANGED
@@ -14,12 +14,11 @@ import { isSupported } from "./isSupported.js";
14
14
  declare let self: ServiceWorkerGlobalScope;
15
15
 
16
16
  /**
17
- * If the browser supports Navigation Preload, then this will enable it.
17
+ * If the browser supports navigation preloading, then this will enable it.
18
18
  *
19
- * @param headerValue Optionally, allows developers to
20
- * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
21
- * the value of the `Service-Worker-Navigation-Preload` header which will be
22
- * sent to the server when making the navigation request.
19
+ * @param headerValue Optional. Allows developers to override the value of
20
+ * the `Service-Worker-Navigation-Preload` header which will be sent to the
21
+ * server when making the navigation request.
23
22
  */
24
23
  export const enable = (headerValue?: string): void => {
25
24
  if (isSupported()) {
@@ -10,8 +10,10 @@
10
10
  declare let self: ServiceWorkerGlobalScope;
11
11
 
12
12
  /**
13
- * @returns Whether or not the current browser supports enabling
14
- * navigation preload.
13
+ * Checks whether the current browser supports
14
+ * navigation preloading.
15
+ *
16
+ * @returns
15
17
  */
16
18
  export const isSupported = (): boolean => {
17
19
  return Boolean(self.registration?.navigationPreload);