Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@serwist/navigation-preload

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serwist/navigation-preload - npm Package Compare versions

Comparing version 9.0.0-preview.18 to 9.0.0-preview.19

5

dist/index.d.ts

@@ -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

43

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc