@serwist/navigation-preload
Advanced tools
Comparing version 9.0.0-preview.18 to 9.0.0-preview.19
@@ -1,5 +0,2 @@ | ||
import { disable } from "./disable.js"; | ||
import { enable } from "./enable.js"; | ||
import { isSupported } from "./isSupported.js"; | ||
export { disable, enable, isSupported }; | ||
export { disableNavigationPreload as disable, enableNavigationPreload as enable, isNavigationPreloadSupported as isSupported } from "@serwist/sw"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,42 +0,1 @@ | ||
import { logger } from '@serwist/core/internal'; | ||
const isSupported = ()=>{ | ||
return Boolean(self.registration?.navigationPreload); | ||
}; | ||
const disable = ()=>{ | ||
if (isSupported()) { | ||
self.addEventListener("activate", (event)=>{ | ||
event.waitUntil(self.registration.navigationPreload.disable().then(()=>{ | ||
if (process.env.NODE_ENV !== "production") { | ||
logger.log("Navigation preloading is disabled."); | ||
} | ||
})); | ||
}); | ||
} else { | ||
if (process.env.NODE_ENV !== "production") { | ||
logger.log("Navigation preloading is not supported in this browser."); | ||
} | ||
} | ||
}; | ||
const enable = (headerValue)=>{ | ||
if (isSupported()) { | ||
self.addEventListener("activate", (event)=>{ | ||
event.waitUntil(self.registration.navigationPreload.enable().then(()=>{ | ||
if (headerValue) { | ||
void self.registration.navigationPreload.setHeaderValue(headerValue); | ||
} | ||
if (process.env.NODE_ENV !== "production") { | ||
logger.log("Navigation preloading is enabled."); | ||
} | ||
})); | ||
}); | ||
} else { | ||
if (process.env.NODE_ENV !== "production") { | ||
logger.log("Navigation preloading is not supported in this browser."); | ||
} | ||
} | ||
}; | ||
export { disable, enable, isSupported }; | ||
export { disableNavigationPreload as disable, enableNavigationPreload as enable, isNavigationPreloadSupported as isSupported } from '@serwist/sw'; |
{ | ||
"name": "@serwist/navigation-preload", | ||
"version": "9.0.0-preview.18", | ||
"version": "9.0.0-preview.19", | ||
"type": "module", | ||
@@ -19,4 +19,4 @@ "description": "A module that allows developers to enable navigation preloading in their service worker.", | ||
"license": "MIT", | ||
"repository": "serwist/serwist", | ||
"bugs": "https://github.com/serwist/serwist/issues", | ||
"repository": "https://gitlab.com/serwist/serwist", | ||
"bugs": "https://gitlab.com/serwist/serwist/issues", | ||
"homepage": "https://serwist.pages.dev", | ||
@@ -33,3 +33,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@serwist/core": "9.0.0-preview.18" | ||
"@serwist/sw": "9.0.0-preview.19" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
"typescript": "5.5.0-dev.20240323", | ||
"@serwist/constants": "9.0.0-preview.18" | ||
"@serwist/constants": "9.0.0-preview.19" | ||
}, | ||
@@ -52,3 +52,2 @@ "peerDependencies": { | ||
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js", | ||
"dev": "rollup --config rollup.config.js --watch", | ||
"lint": "biome lint ./src", | ||
@@ -55,0 +54,0 @@ "typecheck": "tsc" |
@@ -1,13 +0,1 @@ | ||
/* | ||
Copyright 2018 Google LLC | ||
Use of this source code is governed by an MIT-style | ||
license that can be found in the LICENSE file or at | ||
https://opensource.org/licenses/MIT. | ||
*/ | ||
import { disable } from "./disable.js"; | ||
import { enable } from "./enable.js"; | ||
import { isSupported } from "./isSupported.js"; | ||
export { disable, enable, isSupported }; | ||
export { disableNavigationPreload as disable, enableNavigationPreload as enable, isNavigationPreloadSupported as isSupported } from "@serwist/sw"; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
100
1
3220
7
3
1
+ Added@serwist/sw@9.0.0-preview.19
+ Added@serwist/core@9.0.0-preview.19(transitive)
+ Added@serwist/sw@9.0.0-preview.19(transitive)
+ Addedidb@8.0.0(transitive)
- Removed@serwist/core@9.0.0-preview.18
- Removed@serwist/core@9.0.0-preview.18(transitive)