@docusaurus/plugin-pwa 0.0.0-4731 → 0.0.0-4732

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/lib/registerSw.js CHANGED
@@ -79,7 +79,7 @@ function isStandaloneDisplayMode() {
79
79
  const OfflineModeActivationStrategiesImplementations = {
80
80
  always: () => true,
81
81
  mobile: () => window.innerWidth <= MAX_MOBILE_WIDTH,
82
- saveData: () => !!(navigator.connection && navigator.connection.saveData),
82
+ saveData: () => !!navigator.connection?.saveData,
83
83
  appInstalled: async () => {
84
84
  const installedEventFired = await isAppInstalledEventFired();
85
85
  const installedRelatedApps = await isAppInstalledRelatedApps();
package/lib/sw.js CHANGED
@@ -137,7 +137,7 @@ function getPossibleURLs(url) {
137
137
  });
138
138
  }
139
139
 
140
- const type = event.data && event.data.type;
140
+ const type = event.data?.type;
141
141
 
142
142
  if (type === 'SKIP_WAITING') {
143
143
  self.skipWaiting();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-pwa",
3
- "version": "0.0.0-4731",
3
+ "version": "0.0.0-4732",
4
4
  "description": "Docusaurus Plugin to add PWA support.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-pwa.d.ts",
@@ -22,11 +22,11 @@
22
22
  "dependencies": {
23
23
  "@babel/core": "^7.17.7",
24
24
  "@babel/preset-env": "^7.16.11",
25
- "@docusaurus/core": "0.0.0-4731",
26
- "@docusaurus/theme-common": "0.0.0-4731",
27
- "@docusaurus/theme-translations": "0.0.0-4731",
28
- "@docusaurus/utils": "0.0.0-4731",
29
- "@docusaurus/utils-validation": "0.0.0-4731",
25
+ "@docusaurus/core": "0.0.0-4732",
26
+ "@docusaurus/theme-common": "0.0.0-4732",
27
+ "@docusaurus/theme-translations": "0.0.0-4732",
28
+ "@docusaurus/utils": "0.0.0-4732",
29
+ "@docusaurus/utils-validation": "0.0.0-4732",
30
30
  "babel-loader": "^8.2.3",
31
31
  "clsx": "^1.1.1",
32
32
  "core-js": "^3.21.1",
@@ -39,12 +39,12 @@
39
39
  "workbox-window": "^6.5.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@docusaurus/module-type-aliases": "0.0.0-4731",
42
+ "@docusaurus/module-type-aliases": "0.0.0-4732",
43
43
  "fs-extra": "^10.0.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": "^16.8.4 || ^17.0.0",
47
47
  "react-dom": "^16.8.4 || ^17.0.0"
48
48
  },
49
- "gitHead": "f3787c5cd81d0d934005814e3038d897f5ba58aa"
49
+ "gitHead": "da1dfdadc386a446278acd3922f327b291b7b7f1"
50
50
  }
package/src/registerSw.js CHANGED
@@ -79,7 +79,7 @@ function isStandaloneDisplayMode() {
79
79
  const OfflineModeActivationStrategiesImplementations = {
80
80
  always: () => true,
81
81
  mobile: () => window.innerWidth <= MAX_MOBILE_WIDTH,
82
- saveData: () => !!(navigator.connection && navigator.connection.saveData),
82
+ saveData: () => !!navigator.connection?.saveData,
83
83
  appInstalled: async () => {
84
84
  const installedEventFired = await isAppInstalledEventFired();
85
85
  const installedRelatedApps = await isAppInstalledRelatedApps();
package/src/sw.js CHANGED
@@ -137,7 +137,7 @@ function getPossibleURLs(url) {
137
137
  });
138
138
  }
139
139
 
140
- const type = event.data && event.data.type;
140
+ const type = event.data?.type;
141
141
 
142
142
  if (type === 'SKIP_WAITING') {
143
143
  self.skipWaiting();