service-worker-mock
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -10,3 +10,3 @@ // https://developer.mozilla.org/en-US/docs/Web/API/Cache | ||
if (this.store.has(url)) { | ||
return Promise.resolve(this.store.get(url)[0]); | ||
return Promise.resolve(this.store.get(url)); | ||
} | ||
@@ -19,3 +19,3 @@ return Promise.resolve(null); | ||
if (this.store.has(url)) { | ||
return Promise.resolve(this.store.get(url)); | ||
return Promise.resolve([this.store.get(url)]); | ||
} | ||
@@ -39,7 +39,3 @@ return Promise.resolve(null); | ||
const url = request.url || request; | ||
if (this.store.has(url)) { | ||
this.store.get(url).push(response); | ||
} else { | ||
this.store.set(url, [response]); | ||
} | ||
this.store.set(url, response); | ||
return Promise.resolve(); | ||
@@ -50,7 +46,3 @@ } | ||
const url = request.url || request; | ||
if (this.store.has(url)) { | ||
this.store.delete(url); | ||
return Promise.resolve(true); | ||
} | ||
return Promise.resolve(false); | ||
return Promise.resolve(this.store.delete(url)); | ||
} | ||
@@ -70,3 +62,3 @@ | ||
} | ||
snapshot[key] = entry[1][0]; | ||
snapshot[key] = entry[1]; | ||
} | ||
@@ -73,0 +65,0 @@ return snapshot; |
@@ -5,3 +5,3 @@ // stubs https://developer.mozilla.org/en-US/docs/Web/API/Response | ||
this.body = body || ''; | ||
this.status = (init && init.status) || 200; | ||
this.status = (init && typeof init.status === 'number') ? init.status : 200; | ||
this.ok = this.status >= 200 && this.status < 300; | ||
@@ -8,0 +8,0 @@ this.statusText = (init && init.statusText) || 'OK'; |
{ | ||
"name": "service-worker-mock", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
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
15946
411