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

workbox-core

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-core - npm Package Compare versions

Comparing version 5.0.0-rc.1 to 5.0.0-rc.2

2

_private/executeQuotaErrorCallbacks.d.ts

@@ -6,3 +6,3 @@ import '../_version.js';

*
* @memberof workbox.core
* @memberof module:workbox-core
* @private

@@ -9,0 +9,0 @@ */

@@ -15,3 +15,3 @@ /*

*
* @memberof workbox.core
* @memberof module:workbox-core
* @private

@@ -18,0 +18,0 @@ */

@@ -9,3 +9,7 @@ /*

const logger = (process.env.NODE_ENV === 'production' ? null : (() => {
self.__WB_DISABLE_DEV_LOGS = false;
// Don't overwrite this value if it's already set.
// See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
if (!('__WB_DISABLE_DEV_LOGS' in self)) {
self.__WB_DISABLE_DEV_LOGS = false;
}
let inGroup = false;

@@ -12,0 +16,0 @@ const methodToColorMap = {

"use strict";
// @ts-ignore
try {
self['workbox:core:5.0.0-rc.1'] && _();
self['workbox:core:5.0.0-rc.2'] && _();
}
catch (e) { }

@@ -6,3 +6,3 @@ this.workbox = this.workbox || {};

try {
self['workbox:core:5.0.0-rc.1'] && _();
self['workbox:core:5.0.0-rc.2'] && _();
} catch (e) {}

@@ -17,3 +17,8 @@

const logger = (() => {
self.__WB_DISABLE_DEV_LOGS = false;
// Don't overwrite this value if it's already set.
// See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
if (!('__WB_DISABLE_DEV_LOGS' in self)) {
self.__WB_DISABLE_DEV_LOGS = false;
}
let inGroup = false;

@@ -516,3 +521,3 @@ const methodToColorMap = {

* @param {Function} callback
* @memberof workbox.core
* @memberof module:workbox-core
*/

@@ -597,3 +602,3 @@

*
* @memberof workbox.core
* @memberof module:workbox-core
* @private

@@ -1704,3 +1709,3 @@ */

*
* @alias workbox.core.cacheNames
* @memberof module:workbox-core
*/

@@ -1752,3 +1757,3 @@

* @param {Function} modifier
* @alias workbox.core.copyResponse
* @memberof module:workbox-core
*/

@@ -1784,8 +1789,8 @@

*
* @alias workbox.core.clientsClaim
* @memberof module:workbox-core
*/
const clientsClaim = () => {
function clientsClaim() {
self.addEventListener('activate', () => self.clients.claim());
};
}

@@ -1814,6 +1819,6 @@ /*

*
* @alias workbox.core.setCacheNameDetails
* @memberof module:workbox-core
*/
const setCacheNameDetails = details => {
function setCacheNameDetails(details) {
{

@@ -1851,3 +1856,3 @@ Object.keys(details).forEach(key => {

cacheNames.updateDetails(details);
};
}

@@ -1862,13 +1867,14 @@ /*

/**
* Force a service worker to become active, instead of waiting. This is
* normally used in conjunction with `clientsClaim()`.
* Force a service worker to activate immediately, instead of
* [waiting](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#waiting)
* for existing clients to close.
*
* @alias workbox.core.skipWaiting
* @memberof module:workbox-core
*/
const skipWaiting = () => {
function skipWaiting() {
// We need to explicitly call `self.skipWaiting()` here because we're
// shadowing `skipWaiting` with this local function.
self.addEventListener('install', () => self.skipWaiting());
};
}

@@ -1875,0 +1881,0 @@ exports._private = _private;

@@ -1,2 +0,2 @@

this.workbox=this.workbox||{},this.workbox.core=function(e){"use strict";try{self["workbox:core:5.0.0-rc.1"]&&_()}catch(e){}const t=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n};class n extends Error{constructor(e,n){super(t(e,n)),this.name=e,this.details=n}}const s=new Set;const r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},a=e=>[r.prefix,e,r.suffix].filter(e=>e&&e.length>0).join("-"),i={updateDetails:e=>{(e=>{for(const t of Object.keys(r))e(t)})(t=>{"string"==typeof e[t]&&(r[t]=e[t])})},getGoogleAnalyticsName:e=>e||a(r.googleAnalytics),getPrecacheName:e=>e||a(r.precache),getPrefix:()=>r.prefix,getRuntimeName:e=>e||a(r.runtime),getSuffix:()=>r.suffix};async function o(){for(const e of s)await e()}const c=e=>{const t=new URL(String(e),location.href);return t.origin===location.origin?t.pathname:t.href},u=(e,t)=>e.filter(e=>t in e),l=async({cacheName:e,request:t,event:n,matchOptions:s,plugins:r=[]})=>{const a=await self.caches.open(e),i=await f({plugins:r,request:t,mode:"read"});let o=await a.match(i,s);for(const t of r)if("cachedResponseWillBeUsed"in t){const r=t.cachedResponseWillBeUsed;o=await r.call(t,{cacheName:e,event:n,matchOptions:s,cachedResponse:o,request:i})}return o},h=async({request:e,response:t,event:n,plugins:s=[]})=>{let r=t,a=!1;for(let t of s)if("cacheWillUpdate"in t){a=!0;const s=t.cacheWillUpdate;if(!(r=await s.call(t,{request:e,response:r,event:n})))break}return a||(r=r&&200===r.status?r:void 0),r||null},f=async({request:e,mode:t,plugins:n=[]})=>{const s=u(n,"cacheKeyWillBeUsed");let r=e;for(const e of s)"string"==typeof(r=await e.cacheKeyWillBeUsed.call(e,{mode:t,request:r}))&&(r=new Request(r));return r},w={put:async({cacheName:e,request:t,response:s,event:r,plugins:a=[],matchOptions:i})=>{const w=await f({plugins:a,request:t,mode:"write"});if(!s)throw new n("cache-put-with-no-response",{url:c(w.url)});let d=await h({event:r,plugins:a,response:s,request:w});if(!d)return;const p=await self.caches.open(e),g=u(a,"cacheDidUpdate");let y=g.length>0?await l({cacheName:e,matchOptions:i,request:w}):null;try{await p.put(w,d)}catch(e){throw"QuotaExceededError"===e.name&&await o(),e}for(let t of g)await t.cacheDidUpdate.call(t,{cacheName:e,event:r,oldResponse:y,newResponse:d,request:w})},match:l};let d,p;function g(){if(void 0===p){const e=new Response("");if("body"in e)try{new Response(e.body),p=!0}catch(e){p=!1}p=!1}return p}class y{constructor(e,t,{onupgradeneeded:n,onversionchange:s}={}){this.t=null,this.s=e,this.i=t,this.o=n,this.u=s||(()=>this.close())}get db(){return this.t}async open(){if(!this.t)return this.t=await new Promise((e,t)=>{let n=!1;setTimeout(()=>{n=!0,t(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const s=indexedDB.open(this.s,this.i);s.onerror=(()=>t(s.error)),s.onupgradeneeded=(e=>{n?(s.transaction.abort(),s.result.close()):"function"==typeof this.o&&this.o(e)}),s.onsuccess=(()=>{const t=s.result;n?t.close():(t.onversionchange=this.u.bind(this),e(t))})}),this}async getKey(e,t){return(await this.getAllKeys(e,t,1))[0]}async getAll(e,t,n){return await this.getAllMatching(e,{query:t,count:n})}async getAllKeys(e,t,n){return(await this.getAllMatching(e,{query:t,count:n,includeKeys:!0})).map(e=>e.key)}async getAllMatching(e,{index:t,query:n=null,direction:s="next",count:r,includeKeys:a=!1}={}){return await this.transaction([e],"readonly",(i,o)=>{const c=i.objectStore(e),u=t?c.index(t):c,l=[],h=u.openCursor(n,s);h.onsuccess=(()=>{const e=h.result;e?(l.push(a?e:e.value),r&&l.length>=r?o(l):e.continue()):o(l)})})}async transaction(e,t,n){return await this.open(),await new Promise((s,r)=>{const a=this.t.transaction(e,t);a.onabort=(()=>r(a.error)),a.oncomplete=(()=>s()),n(a,e=>s(e))})}async l(e,t,n,...s){return await this.transaction([t],n,(n,r)=>{const a=n.objectStore(t),i=a[e].apply(a,s);i.onsuccess=(()=>r(i.result))})}close(){this.t&&(this.t.close(),this.t=null)}}y.prototype.OPEN_TIMEOUT=2e3;const m={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[e,t]of Object.entries(m))for(const n of t)n in IDBObjectStore.prototype&&(y.prototype[n]=async function(t,...s){return await this.l(n,t,e,...s)});const q={fetch:async({request:e,fetchOptions:t,event:s,plugins:r=[]})=>{if("string"==typeof e&&(e=new Request(e)),s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const a=u(r,"fetchDidFail"),i=a.length>0?e.clone():null;try{for(let t of r)if("requestWillFetch"in t){const n=t.requestWillFetch,r=e.clone();e=await n.call(t,{request:r,event:s})}}catch(e){throw new n("plugin-error-request-will-fetch",{thrownError:e})}let o=e.clone();try{let n;n="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of r)"fetchDidSucceed"in e&&(n=await e.fetchDidSucceed.call(e,{event:s,request:o,response:n}));return n}catch(e){for(const t of a)await t.fetchDidFail.call(t,{error:e,event:s,originalRequest:i.clone(),request:o.clone()});throw e}}};function v(e){return new Promise(t=>setTimeout(t,e))}const x=2e3;var R=Object.freeze({assert:null,cacheNames:i,cacheWrapper:w,canConstructReadableStream:function(){if(void 0===d)try{new ReadableStream({start(){}}),d=!0}catch(e){d=!1}return d},canConstructResponseFromBodyStream:g,dontWaitFor:function(e){e.then(()=>{})},DBWrapper:y,Deferred:class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},deleteDatabase:async e=>{await new Promise((t,n)=>{const s=indexedDB.deleteDatabase(e);s.onerror=(()=>{n(s.error)}),s.onblocked=(()=>{n(new Error("Delete blocked"))}),s.onsuccess=(()=>{t()})})},executeQuotaErrorCallbacks:o,fetchWrapper:q,getFriendlyURL:c,logger:null,resultingClientExists:async function(e){if(!e)return;let t=await self.clients.matchAll({type:"window"});const n=new Set(t.map(e=>e.id));let s;const r=performance.now();for(;performance.now()-r<x&&!(s=(t=await self.clients.matchAll({type:"window"})).find(t=>e?t.id===e:!n.has(t.id)));)await v(100);return s},timeout:v,WorkboxError:n});const b={get googleAnalytics(){return i.getGoogleAnalyticsName()},get precache(){return i.getPrecacheName()},get prefix(){return i.getPrefix()},get runtime(){return i.getRuntimeName()},get suffix(){return i.getSuffix()}};return e._private=R,e.cacheNames=b,e.clientsClaim=(()=>{self.addEventListener("activate",()=>self.clients.claim())}),e.copyResponse=async function(e,t){const n=e.clone(),s={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=t?t(s):s,a=g()?n.body:await n.blob();return new Response(a,r)},e.registerQuotaErrorCallback=function(e){s.add(e)},e.setCacheNameDetails=(e=>{i.updateDetails(e)}),e.skipWaiting=(()=>{self.addEventListener("install",()=>self.skipWaiting())}),e}({});
this.workbox=this.workbox||{},this.workbox.core=function(e){"use strict";try{self["workbox:core:5.0.0-rc.2"]&&_()}catch(e){}const t=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n};class n extends Error{constructor(e,n){super(t(e,n)),this.name=e,this.details=n}}const s=new Set;const r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},i=e=>[r.prefix,e,r.suffix].filter(e=>e&&e.length>0).join("-"),a={updateDetails:e=>{(e=>{for(const t of Object.keys(r))e(t)})(t=>{"string"==typeof e[t]&&(r[t]=e[t])})},getGoogleAnalyticsName:e=>e||i(r.googleAnalytics),getPrecacheName:e=>e||i(r.precache),getPrefix:()=>r.prefix,getRuntimeName:e=>e||i(r.runtime),getSuffix:()=>r.suffix};async function o(){for(const e of s)await e()}const c=e=>{const t=new URL(String(e),location.href);return t.origin===location.origin?t.pathname:t.href},u=(e,t)=>e.filter(e=>t in e),l=async({cacheName:e,request:t,event:n,matchOptions:s,plugins:r=[]})=>{const i=await self.caches.open(e),a=await h({plugins:r,request:t,mode:"read"});let o=await i.match(a,s);for(const t of r)if("cachedResponseWillBeUsed"in t){const r=t.cachedResponseWillBeUsed;o=await r.call(t,{cacheName:e,event:n,matchOptions:s,cachedResponse:o,request:a})}return o},f=async({request:e,response:t,event:n,plugins:s=[]})=>{let r=t,i=!1;for(let t of s)if("cacheWillUpdate"in t){i=!0;const s=t.cacheWillUpdate;if(!(r=await s.call(t,{request:e,response:r,event:n})))break}return i||(r=r&&200===r.status?r:void 0),r||null},h=async({request:e,mode:t,plugins:n=[]})=>{const s=u(n,"cacheKeyWillBeUsed");let r=e;for(const e of s)"string"==typeof(r=await e.cacheKeyWillBeUsed.call(e,{mode:t,request:r}))&&(r=new Request(r));return r},w={put:async({cacheName:e,request:t,response:s,event:r,plugins:i=[],matchOptions:a})=>{const w=await h({plugins:i,request:t,mode:"write"});if(!s)throw new n("cache-put-with-no-response",{url:c(w.url)});let d=await f({event:r,plugins:i,response:s,request:w});if(!d)return;const p=await self.caches.open(e),g=u(i,"cacheDidUpdate");let y=g.length>0?await l({cacheName:e,matchOptions:a,request:w}):null;try{await p.put(w,d)}catch(e){throw"QuotaExceededError"===e.name&&await o(),e}for(let t of g)await t.cacheDidUpdate.call(t,{cacheName:e,event:r,oldResponse:y,newResponse:d,request:w})},match:l};let d,p;function g(){if(void 0===p){const e=new Response("");if("body"in e)try{new Response(e.body),p=!0}catch(e){p=!1}p=!1}return p}class y{constructor(e,t,{onupgradeneeded:n,onversionchange:s}={}){this.t=null,this.s=e,this.i=t,this.o=n,this.u=s||(()=>this.close())}get db(){return this.t}async open(){if(!this.t)return this.t=await new Promise((e,t)=>{let n=!1;setTimeout(()=>{n=!0,t(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const s=indexedDB.open(this.s,this.i);s.onerror=(()=>t(s.error)),s.onupgradeneeded=(e=>{n?(s.transaction.abort(),s.result.close()):"function"==typeof this.o&&this.o(e)}),s.onsuccess=(()=>{const t=s.result;n?t.close():(t.onversionchange=this.u.bind(this),e(t))})}),this}async getKey(e,t){return(await this.getAllKeys(e,t,1))[0]}async getAll(e,t,n){return await this.getAllMatching(e,{query:t,count:n})}async getAllKeys(e,t,n){return(await this.getAllMatching(e,{query:t,count:n,includeKeys:!0})).map(e=>e.key)}async getAllMatching(e,{index:t,query:n=null,direction:s="next",count:r,includeKeys:i=!1}={}){return await this.transaction([e],"readonly",(a,o)=>{const c=a.objectStore(e),u=t?c.index(t):c,l=[],f=u.openCursor(n,s);f.onsuccess=(()=>{const e=f.result;e?(l.push(i?e:e.value),r&&l.length>=r?o(l):e.continue()):o(l)})})}async transaction(e,t,n){return await this.open(),await new Promise((s,r)=>{const i=this.t.transaction(e,t);i.onabort=(()=>r(i.error)),i.oncomplete=(()=>s()),n(i,e=>s(e))})}async l(e,t,n,...s){return await this.transaction([t],n,(n,r)=>{const i=n.objectStore(t),a=i[e].apply(i,s);a.onsuccess=(()=>r(a.result))})}close(){this.t&&(this.t.close(),this.t=null)}}y.prototype.OPEN_TIMEOUT=2e3;const m={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[e,t]of Object.entries(m))for(const n of t)n in IDBObjectStore.prototype&&(y.prototype[n]=async function(t,...s){return await this.l(n,t,e,...s)});const q={fetch:async({request:e,fetchOptions:t,event:s,plugins:r=[]})=>{if("string"==typeof e&&(e=new Request(e)),s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const i=u(r,"fetchDidFail"),a=i.length>0?e.clone():null;try{for(let t of r)if("requestWillFetch"in t){const n=t.requestWillFetch,r=e.clone();e=await n.call(t,{request:r,event:s})}}catch(e){throw new n("plugin-error-request-will-fetch",{thrownError:e})}let o=e.clone();try{let n;n="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of r)"fetchDidSucceed"in e&&(n=await e.fetchDidSucceed.call(e,{event:s,request:o,response:n}));return n}catch(e){for(const t of i)await t.fetchDidFail.call(t,{error:e,event:s,originalRequest:a.clone(),request:o.clone()});throw e}}};function v(e){return new Promise(t=>setTimeout(t,e))}const x=2e3;var R=Object.freeze({assert:null,cacheNames:a,cacheWrapper:w,canConstructReadableStream:function(){if(void 0===d)try{new ReadableStream({start(){}}),d=!0}catch(e){d=!1}return d},canConstructResponseFromBodyStream:g,dontWaitFor:function(e){e.then(()=>{})},DBWrapper:y,Deferred:class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},deleteDatabase:async e=>{await new Promise((t,n)=>{const s=indexedDB.deleteDatabase(e);s.onerror=(()=>{n(s.error)}),s.onblocked=(()=>{n(new Error("Delete blocked"))}),s.onsuccess=(()=>{t()})})},executeQuotaErrorCallbacks:o,fetchWrapper:q,getFriendlyURL:c,logger:null,resultingClientExists:async function(e){if(!e)return;let t=await self.clients.matchAll({type:"window"});const n=new Set(t.map(e=>e.id));let s;const r=performance.now();for(;performance.now()-r<x&&!(s=(t=await self.clients.matchAll({type:"window"})).find(t=>e?t.id===e:!n.has(t.id)));)await v(100);return s},timeout:v,WorkboxError:n});const b={get googleAnalytics(){return a.getGoogleAnalyticsName()},get precache(){return a.getPrecacheName()},get prefix(){return a.getPrefix()},get runtime(){return a.getRuntimeName()},get suffix(){return a.getSuffix()}};return e._private=R,e.cacheNames=b,e.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},e.copyResponse=async function(e,t){const n=e.clone(),s={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=t?t(s):s,i=g()?n.body:await n.blob();return new Response(i,r)},e.registerQuotaErrorCallback=function(e){s.add(e)},e.setCacheNameDetails=function(e){a.updateDetails(e)},e.skipWaiting=function(){self.addEventListener("install",()=>self.skipWaiting())},e}({});
//# sourceMappingURL=workbox-core.prod.js.map

@@ -15,5 +15,5 @@ import './_version.js';

*
* @alias workbox.core.cacheNames
* @memberof module:workbox-core
*/
export declare const cacheNames: {
declare const cacheNames: {
readonly googleAnalytics: string;

@@ -25,1 +25,2 @@ readonly precache: string;

};
export { cacheNames };

@@ -23,5 +23,5 @@ /*

*
* @alias workbox.core.cacheNames
* @memberof module:workbox-core
*/
export const cacheNames = {
const cacheNames = {
get googleAnalytics() {

@@ -43,1 +43,2 @@ return _cacheNames.getGoogleAnalyticsName();

};
export { cacheNames };

@@ -6,4 +6,5 @@ import './_version.js';

*
* @alias workbox.core.clientsClaim
* @memberof module:workbox-core
*/
export declare const clientsClaim: () => void;
declare function clientsClaim(): void;
export { clientsClaim };

@@ -13,6 +13,8 @@ /*

*
* @alias workbox.core.clientsClaim
* @memberof module:workbox-core
*/
export const clientsClaim = () => {
function clientsClaim() {
self.addEventListener('activate', () => self.clients.claim());
};
}
;
export { clientsClaim };

@@ -16,5 +16,5 @@ import './_version.js';

* @param {Function} modifier
* @alias workbox.core.copyResponse
* @memberof module:workbox-core
*/
declare function copyResponse(response: Response, modifier?: (responseInit: ResponseInit) => ResponseInit): Promise<Response>;
export { copyResponse };

@@ -24,3 +24,3 @@ /*

* @param {Function} modifier
* @alias workbox.core.copyResponse
* @memberof module:workbox-core
*/

@@ -27,0 +27,0 @@ async function copyResponse(response, modifier) {

@@ -14,5 +14,5 @@ import { registerQuotaErrorCallback } from './registerQuotaErrorCallback.js';

*
* @namespace workbox.core
* @module workbox-core
*/
export { _private, cacheNames, clientsClaim, copyResponse, registerQuotaErrorCallback, setCacheNameDetails, skipWaiting, };
export * from './types.js';

@@ -21,4 +21,4 @@ /*

*
* @namespace workbox.core
* @module workbox-core
*/
export { _private, cacheNames, clientsClaim, copyResponse, registerQuotaErrorCallback, setCacheNameDetails, skipWaiting, };
{
"name": "workbox-core",
"version": "5.0.0-rc.1",
"version": "5.0.0-rc.2",
"license": "MIT",

@@ -28,3 +28,3 @@ "author": "Google's Web DevRel Team",

"types": "index.d.ts",
"gitHead": "f03f71e50507e13d82d4e0a875cc49ba4501aff3"
"gitHead": "89904768b2210e59c830dd380cf88a06e1c26a2b"
}

@@ -7,5 +7,5 @@ import './_version.js';

* @param {Function} callback
* @memberof workbox.core
* @memberof module:workbox-core
*/
declare function registerQuotaErrorCallback(callback: Function): void;
export { registerQuotaErrorCallback };

@@ -17,3 +17,3 @@ /*

* @param {Function} callback
* @memberof workbox.core
* @memberof module:workbox-core
*/

@@ -20,0 +20,0 @@ function registerQuotaErrorCallback(callback) {

@@ -18,4 +18,5 @@ import { PartialCacheNameDetails } from './_private/cacheNames.js';

*
* @alias workbox.core.setCacheNameDetails
* @memberof module:workbox-core
*/
export declare const setCacheNameDetails: (details: PartialCacheNameDetails) => void;
declare function setCacheNameDetails(details: PartialCacheNameDetails): void;
export { setCacheNameDetails };

@@ -27,5 +27,5 @@ /*

*
* @alias workbox.core.setCacheNameDetails
* @memberof module:workbox-core
*/
export const setCacheNameDetails = (details) => {
function setCacheNameDetails(details) {
if (process.env.NODE_ENV !== 'production') {

@@ -59,2 +59,4 @@ Object.keys(details).forEach((key) => {

cacheNames.updateDetails(details);
};
}
;
export { setCacheNameDetails };
import './_version.js';
/**
* Force a service worker to become active, instead of waiting. This is
* normally used in conjunction with `clientsClaim()`.
* Force a service worker to activate immediately, instead of
* [waiting](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#waiting)
* for existing clients to close.
*
* @alias workbox.core.skipWaiting
* @memberof module:workbox-core
*/
export declare const skipWaiting: () => void;
declare function skipWaiting(): void;
export { skipWaiting };

@@ -10,11 +10,14 @@ /*

/**
* Force a service worker to become active, instead of waiting. This is
* normally used in conjunction with `clientsClaim()`.
* Force a service worker to activate immediately, instead of
* [waiting](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#waiting)
* for existing clients to close.
*
* @alias workbox.core.skipWaiting
* @memberof module:workbox-core
*/
export const skipWaiting = () => {
function skipWaiting() {
// We need to explicitly call `self.skipWaiting()` here because we're
// shadowing `skipWaiting` with this local function.
self.addEventListener('install', () => self.skipWaiting());
};
}
;
export { skipWaiting };

@@ -18,3 +18,3 @@ /*

*
* @memberof workbox.core
* @memberof module:workbox-core
* @private

@@ -21,0 +21,0 @@ */

@@ -24,3 +24,7 @@ /*

const logger = <Console> (process.env.NODE_ENV === 'production' ? null : (() => {
self.__WB_DISABLE_DEV_LOGS = false;
// Don't overwrite this value if it's already set.
// See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
if (!('__WB_DISABLE_DEV_LOGS' in self!)) {
self.__WB_DISABLE_DEV_LOGS = false;
}

@@ -27,0 +31,0 @@ let inGroup = false;

// @ts-ignore
try{self['workbox:core:5.0.0-rc.1']&&_()}catch(e){}
try{self['workbox:core:5.0.0-rc.2']&&_()}catch(e){}

@@ -26,5 +26,5 @@ /*

*
* @alias workbox.core.cacheNames
* @memberof module:workbox-core
*/
export const cacheNames = {
const cacheNames = {
get googleAnalytics() {

@@ -46,1 +46,3 @@ return _cacheNames.getGoogleAnalyticsName();

};
export {cacheNames}

@@ -19,6 +19,8 @@ /*

*
* @alias workbox.core.clientsClaim
* @memberof module:workbox-core
*/
export const clientsClaim = () => {
function clientsClaim() {
self.addEventListener('activate', () => self.clients.claim());
};
export {clientsClaim}

@@ -27,3 +27,3 @@ /*

* @param {Function} modifier
* @alias workbox.core.copyResponse
* @memberof module:workbox-core
*/

@@ -30,0 +30,0 @@ async function copyResponse(

@@ -24,3 +24,3 @@ /*

*
* @namespace workbox.core
* @module workbox-core
*/

@@ -27,0 +27,0 @@ export {

@@ -20,3 +20,3 @@ /*

* @param {Function} callback
* @memberof workbox.core
* @memberof module:workbox-core
*/

@@ -23,0 +23,0 @@ function registerQuotaErrorCallback(callback: Function) {

@@ -30,5 +30,5 @@ /*

*
* @alias workbox.core.setCacheNameDetails
* @memberof module:workbox-core
*/
export const setCacheNameDetails = (details: PartialCacheNameDetails) => {
function setCacheNameDetails(details: PartialCacheNameDetails) {
if (process.env.NODE_ENV !== 'production') {

@@ -67,1 +67,3 @@ Object.keys(details).forEach((key) => {

};
export {setCacheNameDetails}

@@ -16,8 +16,9 @@ /*

/**
* Force a service worker to become active, instead of waiting. This is
* normally used in conjunction with `clientsClaim()`.
* Force a service worker to activate immediately, instead of
* [waiting](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#waiting)
* for existing clients to close.
*
* @alias workbox.core.skipWaiting
* @memberof module:workbox-core
*/
export const skipWaiting = () => {
function skipWaiting() {
// We need to explicitly call `self.skipWaiting()` here because we're

@@ -27,1 +28,3 @@ // shadowing `skipWaiting` with this local function.

};
export {skipWaiting}

@@ -40,3 +40,3 @@ /*

export interface RouteHandlerCallbackOptions {
request: Request;
request: Request | string;
url?: URL;

@@ -43,0 +43,0 @@ event?: ExtendableEvent;

@@ -28,3 +28,3 @@ import './_version.js';

export interface RouteHandlerCallbackOptions {
request: Request;
request: Request | string;
url?: URL;

@@ -31,0 +31,0 @@ event?: ExtendableEvent;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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