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

service-worker-mock

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

service-worker-mock - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

18

models/Cache.js

@@ -10,3 +10,4 @@ // https://developer.mozilla.org/en-US/docs/Web/API/Cache

if (this.store.has(url)) {
return Promise.resolve(this.store.get(url));
const value = this.store.get(url);
return Promise.resolve(value.response);
}

@@ -19,3 +20,4 @@ return Promise.resolve(null);

if (this.store.has(url)) {
return Promise.resolve([this.store.get(url)]);
const value = this.store.get(url);
return Promise.resolve([value.response]);
}

@@ -38,4 +40,7 @@ return Promise.resolve(null);

put(request, response) {
const url = request.url || request;
this.store.set(url, response);
if (typeof request === 'string') {
request = new Request(request);
}
this.store.set(request.url, { request, response });
return Promise.resolve();

@@ -50,3 +55,4 @@ }

keys() {
return Promise.resolve(Array.from(this.store.keys()));
const values = Array.from(this.store.values());
return Promise.resolve(values.map((value) => value.request));
}

@@ -62,3 +68,3 @@

}
snapshot[key] = entry[1];
snapshot[key] = entry[1].response;
}

@@ -65,0 +71,0 @@ return snapshot;

{
"name": "service-worker-mock",
"version": "1.2.3",
"version": "1.2.4",
"main": "index.js",

@@ -5,0 +5,0 @@ "repository": {

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