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

workbox-precaching

Package Overview
Dependencies
Maintainers
6
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-precaching - npm Package Compare versions

Comparing version 6.4.2 to 6.5.0

8

_types.d.ts

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -38,3 +38,3 @@ /**

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -48,3 +48,3 @@ /**

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -65,3 +65,3 @@ /**

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -22,3 +22,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -30,3 +30,3 @@ /**

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -57,3 +57,3 @@ /**

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
"use strict";
// @ts-ignore
try {
self['workbox:precaching:6.4.1'] && _();
self['workbox:precaching:6.4.2'] && _();
}
catch (e) { }

@@ -8,5 +8,5 @@ import { WorkboxPlugin } from 'workbox-core/types.js';

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function addPlugins(plugins: WorkboxPlugin[]): void;
export { addPlugins };

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -18,0 +18,0 @@ function addPlugins(plugins) {

@@ -13,8 +13,8 @@ import { PrecacheRouteOptions } from './_types.js';

*
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
* options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function addRoute(options?: PrecacheRouteOptions): void;
export { addRoute };

@@ -21,6 +21,6 @@ /*

*
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
* options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -27,0 +27,0 @@ function addRoute(options) {

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

try {
self['workbox:precaching:6.4.1'] && _();
self['workbox:precaching:6.4.2'] && _();
} catch (e) {}

@@ -26,3 +26,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -198,3 +198,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -245,3 +245,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -279,5 +279,5 @@

/**
* A [Strategy]{@link module:workbox-strategies.Strategy} implementation
* A {@link workbox-strategies.Strategy} implementation
* specifically designed to work with
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* to both cache and fetch precached assets.

@@ -288,4 +288,4 @@ *

*
* @extends module:workbox-strategies.Strategy
* @memberof module:workbox-precaching
* @extends workbox-strategies.Strategy
* @memberof workbox-precaching
*/

@@ -299,10 +299,10 @@

* requests. Defaults to the cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* {@link workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
* {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
* of all fetch() requests made by this strategy.
* @param {Object} [options.matchOptions] The
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
* {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
* for any `cache.match()` or `cache.put()` calls made by this strategy.

@@ -325,3 +325,3 @@ * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to

* @param {Request|string} request A request to run this strategy for.
* @param {module:workbox-strategies.StrategyHandler} handler The event that
* @param {workbox-strategies.StrategyHandler} handler The event that
* triggered the request.

@@ -518,3 +518,3 @@ * @return {Promise<Response>}

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -553,3 +553,3 @@

/**
* @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* used to cache assets and respond to fetch events.

@@ -565,3 +565,3 @@ */

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -588,3 +588,3 @@ *

*
* @param {Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* Array of entries to precache.

@@ -658,3 +658,3 @@ */

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.InstallResult>}
* @return {Promise<workbox-precaching.InstallResult>}
*/

@@ -713,3 +713,3 @@

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.CleanupResult>}
* @return {Promise<workbox-precaching.CleanupResult>}
*/

@@ -827,3 +827,3 @@

* `Response`.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*/

@@ -885,3 +885,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -911,3 +911,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -942,3 +942,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -989,9 +989,9 @@

/**
* A subclass of [Route]{@link module:workbox-routing.Route} that takes a
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* A subclass of {@link workbox-routing.Route} that takes a
* {@link workbox-precaching.PrecacheController}
* instance and uses it to match incoming requests and handle fetching
* responses from the precache.
*
* @memberof module:workbox-precaching
* @extends module:workbox-routing.Route
* @memberof workbox-precaching
* @extends workbox-routing.Route
*/

@@ -1012,3 +1012,3 @@

* check the cache for the URL with a `.html` added to the end of the end.
* @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]
* @param {workbox-precaching~urlManipulation} [options.urlManipulation]
* This is a function that should take a URL and return an array of

@@ -1063,6 +1063,6 @@ * alternative URLs that should be checked for precache matches.

*
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
* options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1100,3 +1100,3 @@

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1124,3 +1124,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1162,5 +1162,5 @@

* response from the network if there's a precache miss.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1197,3 +1197,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1226,3 +1226,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1245,3 +1245,3 @@

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -1253,10 +1253,10 @@ *

* It only precaches files. To respond to a network request you call
* [addRoute()]{@link module:workbox-precaching.addRoute}.
* {@link workbox-precaching.addRoute}.
*
* If you have a single array of files to precache, you can just call
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
* {@link workbox-precaching.precacheAndRoute}.
*
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1281,10 +1281,10 @@

* This is a convenience method that will call
* [precache()]{@link module:workbox-precaching.precache} and
* [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.
* {@link workbox-precaching.precache} and
* {@link workbox-precaching.addRoute} in a single call.
*
* @param {Array<Object|string>} entries Array of entries to precache.
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the
* {@link workbox-precaching.PrecacheRoute} options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1316,3 +1316,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -1319,0 +1319,0 @@

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

this.workbox=this.workbox||{},this.workbox.precaching=function(t,e,s,n,i,c,r,o){"use strict";try{self["workbox:precaching:6.4.1"]&&_()}catch(t){}function a(t){if(!t)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),c=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:c.href}}class h{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class l{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.Z.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.Z=t}}class u extends c.Strategy{constructor(t={}){t.cacheName=e.cacheNames.getPrecacheName(t.cacheName),super(t),this.tt=!1!==t.fallbackToNetwork,this.plugins.push(u.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.et(t,e):await this.st(t,e))}async st(t,e){let n;const i=e.params||{};if(!this.tt)throw new s.WorkboxError("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,c=t.integrity,r=!c||c===s;n=await e.fetch(new Request(t,{integrity:c||s})),s&&r&&(this.nt(),await e.cachePut(t,n.clone()))}return n}async et(t,e){this.nt();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s.WorkboxError("bad-precaching-response",{url:t.url,status:n.status});return n}nt(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==u.copyRedirectedCacheableResponsesPlugin&&(n===u.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(u.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}u.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},u.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await i.copyResponse(t):t};class f{constructor({cacheName:t,plugins:s=[],fallbackToNetwork:n=!0}={}){this.it=new Map,this.ct=new Map,this.rt=new Map,this.ot=new u({cacheName:e.cacheNames.getPrecacheName(t),plugins:[...s,new l({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.ot}precache(t){this.addToCacheList(t),this.at||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.at=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=a(n),c="string"!=typeof n&&n.revision?"reload":"default";if(this.it.has(i)&&this.it.get(i)!==t)throw new s.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:this.it.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.rt.has(t)&&this.rt.get(t)!==n.integrity)throw new s.WorkboxError("add-to-cache-list-conflicting-integrities",{url:i});this.rt.set(t,n.integrity)}if(this.it.set(i,t),this.ct.set(i,c),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return n.waitUntil(t,(async()=>{const e=new h;this.strategy.plugins.push(e);for(const[e,s]of this.it){const n=this.rt.get(s),i=this.ct.get(e),c=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:c,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return n.waitUntil(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.it.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.it}getCachedURLs(){return[...this.it.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.it.get(e.href)}getIntegrityForCacheKey(t){return this.rt.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s.WorkboxError("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let w;const d=()=>(w||(w=new f),w);class y extends o.Route{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const c=new URL(t,location.href);c.hash="",yield c.href;const r=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(c,e);if(yield r.href,s&&r.pathname.endsWith("/")){const t=new URL(r.href);t.pathname+=s,yield t.href}if(n){const t=new URL(r.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:c});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function p(t){const e=d(),s=new y(e,t);r.registerRoute(s)}function R(t){d().precache(t)}return t.PrecacheController=f,t.PrecacheFallbackPlugin=class{constructor({fallbackURL:t,precacheController:e}){this.handlerDidError=()=>this.Z.matchPrecache(this.ht),this.ht=t,this.Z=e||d()}},t.PrecacheRoute=y,t.PrecacheStrategy=u,t.addPlugins=function(t){d().strategy.plugins.push(...t)},t.addRoute=p,t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const s=e.cacheNames.getPrecacheName();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(s).then((t=>{})))}))},t.createHandlerBoundToURL=function(t){return d().createHandlerBoundToURL(t)},t.getCacheKeyForURL=function(t){return d().getCacheKeyForURL(t)},t.matchPrecache=function(t){return d().matchPrecache(t)},t.precache=R,t.precacheAndRoute=function(t,e){R(t),p(e)},t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core,workbox.strategies,workbox.routing,workbox.routing);
this.workbox=this.workbox||{},this.workbox.precaching=function(t,e,s,n,i,c,r,o){"use strict";try{self["workbox:precaching:6.4.2"]&&_()}catch(t){}function a(t){if(!t)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),c=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:c.href}}class h{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class l{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.tt.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.tt=t}}class u extends c.Strategy{constructor(t={}){t.cacheName=e.cacheNames.getPrecacheName(t.cacheName),super(t),this.et=!1!==t.fallbackToNetwork,this.plugins.push(u.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.st(t,e):await this.nt(t,e))}async nt(t,e){let n;const i=e.params||{};if(!this.et)throw new s.WorkboxError("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,c=t.integrity,r=!c||c===s;n=await e.fetch(new Request(t,{integrity:c||s})),s&&r&&(this.it(),await e.cachePut(t,n.clone()))}return n}async st(t,e){this.it();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s.WorkboxError("bad-precaching-response",{url:t.url,status:n.status});return n}it(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==u.copyRedirectedCacheableResponsesPlugin&&(n===u.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(u.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}u.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},u.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await i.copyResponse(t):t};class f{constructor({cacheName:t,plugins:s=[],fallbackToNetwork:n=!0}={}){this.ct=new Map,this.rt=new Map,this.ot=new Map,this.at=new u({cacheName:e.cacheNames.getPrecacheName(t),plugins:[...s,new l({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.at}precache(t){this.addToCacheList(t),this.ht||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.ht=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=a(n),c="string"!=typeof n&&n.revision?"reload":"default";if(this.ct.has(i)&&this.ct.get(i)!==t)throw new s.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:this.ct.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.ot.has(t)&&this.ot.get(t)!==n.integrity)throw new s.WorkboxError("add-to-cache-list-conflicting-integrities",{url:i});this.ot.set(t,n.integrity)}if(this.ct.set(i,t),this.rt.set(i,c),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return n.waitUntil(t,(async()=>{const e=new h;this.strategy.plugins.push(e);for(const[e,s]of this.ct){const n=this.ot.get(s),i=this.rt.get(e),c=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:c,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return n.waitUntil(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.ct.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.ct}getCachedURLs(){return[...this.ct.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.ct.get(e.href)}getIntegrityForCacheKey(t){return this.ot.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s.WorkboxError("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let w;const d=()=>(w||(w=new f),w);class y extends o.Route{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const c=new URL(t,location.href);c.hash="",yield c.href;const r=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(c,e);if(yield r.href,s&&r.pathname.endsWith("/")){const t=new URL(r.href);t.pathname+=s,yield t.href}if(n){const t=new URL(r.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:c});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function p(t){const e=d(),s=new y(e,t);r.registerRoute(s)}function R(t){d().precache(t)}return t.PrecacheController=f,t.PrecacheFallbackPlugin=class{constructor({fallbackURL:t,precacheController:e}){this.handlerDidError=()=>this.tt.matchPrecache(this.lt),this.lt=t,this.tt=e||d()}},t.PrecacheRoute=y,t.PrecacheStrategy=u,t.addPlugins=function(t){d().strategy.plugins.push(...t)},t.addRoute=p,t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const s=e.cacheNames.getPrecacheName();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(s).then((t=>{})))}))},t.createHandlerBoundToURL=function(t){return d().createHandlerBoundToURL(t)},t.getCacheKeyForURL=function(t){return d().getCacheKeyForURL(t)},t.matchPrecache=function(t){return d().matchPrecache(t)},t.precache=R,t.precacheAndRoute=function(t,e){R(t),p(e)},t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core,workbox.strategies,workbox.routing,workbox.routing);
//# sourceMappingURL=workbox-precaching.prod.js.map

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function cleanupOutdatedCaches(): void;
export { cleanupOutdatedCaches };

@@ -16,3 +16,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -19,0 +19,0 @@ function cleanupOutdatedCaches() {

@@ -16,7 +16,7 @@ import { RouteHandlerCallback } from 'workbox-core/types.js';

* response from the network if there's a precache miss.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function createHandlerBoundToURL(url: string): RouteHandlerCallback;
export { createHandlerBoundToURL };

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

* response from the network if there's a precache miss.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -28,0 +28,0 @@ function createHandlerBoundToURL(url) {

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function getCacheKeyForURL(url: string): string | undefined;
export { getCacheKeyForURL };

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -30,0 +30,0 @@ function getCacheKeyForURL(url) {

@@ -16,3 +16,3 @@ import { addPlugins } from './addPlugins.js';

* Most consumers of this module will want to use the
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}
* {@link workbox-precaching.precacheAndRoute}
* method to add assets to the cache and respond to network requests with these

@@ -22,3 +22,3 @@ * cached assets.

* If you require more control over caching and routing, you can use the
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* interface.

@@ -25,0 +25,0 @@ *

@@ -23,3 +23,3 @@ /*

* Most consumers of this module will want to use the
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}
* {@link workbox-precaching.precacheAndRoute}
* method to add assets to the cache and respond to network requests with these

@@ -29,3 +29,3 @@ * cached assets.

* If you require more control over caching and routing, you can use the
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* interface.

@@ -32,0 +32,0 @@ *

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function matchPrecache(request: string | Request): Promise<Response | undefined>;
export { matchPrecache };

@@ -23,3 +23,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -26,0 +26,0 @@ function matchPrecache(request) {

{
"name": "workbox-precaching",
"version": "6.4.2",
"version": "6.5.0",
"license": "MIT",

@@ -24,7 +24,7 @@ "author": "Google's Web DevRel Team",

"dependencies": {
"workbox-core": "6.4.2",
"workbox-routing": "6.4.2",
"workbox-strategies": "6.4.2"
"workbox-core": "6.5.0",
"workbox-routing": "6.5.0",
"workbox-strategies": "6.5.0"
},
"gitHead": "9fae1320327a3a75bf71df9a76708978bd252428"
"gitHead": "d796009eadcba556b2795e0fea7d71a241f535e0"
}

@@ -6,3 +6,3 @@ import { PrecacheEntry } from './_types.js';

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -14,12 +14,12 @@ *

* It only precaches files. To respond to a network request you call
* [addRoute()]{@link module:workbox-precaching.addRoute}.
* {@link workbox-precaching.addRoute}.
*
* If you have a single array of files to precache, you can just call
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
* {@link workbox-precaching.precacheAndRoute}.
*
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function precache(entries: Array<PrecacheEntry | string>): void;
export { precache };

@@ -13,3 +13,3 @@ /*

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -21,10 +21,10 @@ *

* It only precaches files. To respond to a network request you call
* [addRoute()]{@link module:workbox-precaching.addRoute}.
* {@link workbox-precaching.addRoute}.
*
* If you have a single array of files to precache, you can just call
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
* {@link workbox-precaching.precacheAndRoute}.
*
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -31,0 +31,0 @@ function precache(entries) {

@@ -8,12 +8,12 @@ import { PrecacheRouteOptions, PrecacheEntry } from './_types.js';

* This is a convenience method that will call
* [precache()]{@link module:workbox-precaching.precache} and
* [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.
* {@link workbox-precaching.precache} and
* {@link workbox-precaching.addRoute} in a single call.
*
* @param {Array<Object|string>} entries Array of entries to precache.
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the
* {@link workbox-precaching.PrecacheRoute} options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare function precacheAndRoute(entries: Array<PrecacheEntry | string>, options?: PrecacheRouteOptions): void;
export { precacheAndRoute };

@@ -16,10 +16,10 @@ /*

* This is a convenience method that will call
* [precache()]{@link module:workbox-precaching.precache} and
* [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.
* {@link workbox-precaching.precache} and
* {@link workbox-precaching.addRoute} in a single call.
*
* @param {Array<Object|string>} entries Array of entries to precache.
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the
* {@link workbox-precaching.PrecacheRoute} options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -26,0 +26,0 @@ function precacheAndRoute(entries, options) {

@@ -18,3 +18,3 @@ import { Strategy } from 'workbox-strategies/Strategy.js';

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -39,3 +39,3 @@ declare class PrecacheController {

/**
* @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* used to cache assets and respond to fetch events.

@@ -47,3 +47,3 @@ */

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -60,3 +60,3 @@ *

*
* @param {Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* Array of entries to precache.

@@ -73,3 +73,3 @@ */

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.InstallResult>}
* @return {Promise<workbox-precaching.InstallResult>}
*/

@@ -85,3 +85,3 @@ install(event: ExtendableEvent): Promise<InstallResult>;

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.CleanupResult>}
* @return {Promise<workbox-precaching.CleanupResult>}
*/

@@ -144,3 +144,3 @@ activate(event: ExtendableEvent): Promise<CleanupResult>;

* `Response`.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*/

@@ -147,0 +147,0 @@ createHandlerBoundToURL(url: string): RouteHandlerCallback;

@@ -23,3 +23,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -54,3 +54,3 @@ class PrecacheController {

/**
* @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* used to cache assets and respond to fetch events.

@@ -64,3 +64,3 @@ */

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -84,3 +84,3 @@ *

*
* @param {Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* Array of entries to precache.

@@ -149,3 +149,3 @@ */

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.InstallResult>}
* @return {Promise<workbox-precaching.InstallResult>}
*/

@@ -189,3 +189,3 @@ install(event) {

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.CleanupResult>}
* @return {Promise<workbox-precaching.CleanupResult>}
*/

@@ -284,3 +284,3 @@ activate(event) {

* `Response`.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*/

@@ -287,0 +287,0 @@ createHandlerBoundToURL(url) {

@@ -16,3 +16,3 @@ import { WorkboxPlugin } from 'workbox-core/types.js';

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -19,0 +19,0 @@ declare class PrecacheFallbackPlugin implements WorkboxPlugin {

@@ -22,3 +22,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -25,0 +25,0 @@ class PrecacheFallbackPlugin {

@@ -6,9 +6,9 @@ import { Route } from 'workbox-routing/Route.js';

/**
* A subclass of [Route]{@link module:workbox-routing.Route} that takes a
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* A subclass of {@link workbox-routing.Route} that takes a
* {@link workbox-precaching.PrecacheController}
* instance and uses it to match incoming requests and handle fetching
* responses from the precache.
*
* @memberof module:workbox-precaching
* @extends module:workbox-routing.Route
* @memberof workbox-precaching
* @extends workbox-routing.Route
*/

@@ -28,3 +28,3 @@ declare class PrecacheRoute extends Route {

* check the cache for the URL with a `.html` added to the end of the end.
* @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]
* @param {workbox-precaching~urlManipulation} [options.urlManipulation]
* This is a function that should take a URL and return an array of

@@ -31,0 +31,0 @@ * alternative URLs that should be checked for precache matches.

@@ -14,9 +14,9 @@ /*

/**
* A subclass of [Route]{@link module:workbox-routing.Route} that takes a
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* A subclass of {@link workbox-routing.Route} that takes a
* {@link workbox-precaching.PrecacheController}
* instance and uses it to match incoming requests and handle fetching
* responses from the precache.
*
* @memberof module:workbox-precaching
* @extends module:workbox-routing.Route
* @memberof workbox-precaching
* @extends workbox-routing.Route
*/

@@ -36,3 +36,3 @@ class PrecacheRoute extends Route {

* check the cache for the URL with a `.html` added to the end of the end.
* @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]
* @param {workbox-precaching~urlManipulation} [options.urlManipulation]
* This is a function that should take a URL and return an array of

@@ -39,0 +39,0 @@ * alternative URLs that should be checked for precache matches.

@@ -9,5 +9,5 @@ import { WorkboxPlugin } from 'workbox-core/types.js';

/**
* A [Strategy]{@link module:workbox-strategies.Strategy} implementation
* A {@link workbox-strategies.Strategy} implementation
* specifically designed to work with
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* to both cache and fetch precached assets.

@@ -18,4 +18,4 @@ *

*
* @extends module:workbox-strategies.Strategy
* @memberof module:workbox-precaching
* @extends workbox-strategies.Strategy
* @memberof workbox-precaching
*/

@@ -31,10 +31,10 @@ declare class PrecacheStrategy extends Strategy {

* requests. Defaults to the cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* {@link workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
* {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
* of all fetch() requests made by this strategy.
* @param {Object} [options.matchOptions] The
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
* {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
* for any `cache.match()` or `cache.put()` calls made by this strategy.

@@ -48,3 +48,3 @@ * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to

* @param {Request|string} request A request to run this strategy for.
* @param {module:workbox-strategies.StrategyHandler} handler The event that
* @param {workbox-strategies.StrategyHandler} handler The event that
* triggered the request.

@@ -51,0 +51,0 @@ * @return {Promise<Response>}

@@ -16,5 +16,5 @@ /*

/**
* A [Strategy]{@link module:workbox-strategies.Strategy} implementation
* A {@link workbox-strategies.Strategy} implementation
* specifically designed to work with
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* to both cache and fetch precached assets.

@@ -25,4 +25,4 @@ *

*
* @extends module:workbox-strategies.Strategy
* @memberof module:workbox-precaching
* @extends workbox-strategies.Strategy
* @memberof workbox-precaching
*/

@@ -35,10 +35,10 @@ class PrecacheStrategy extends Strategy {

* requests. Defaults to the cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* {@link workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
* {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
* of all fetch() requests made by this strategy.
* @param {Object} [options.matchOptions] The
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
* {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
* for any `cache.match()` or `cache.put()` calls made by this strategy.

@@ -62,3 +62,3 @@ * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to

* @param {Request|string} request A request to run this strategy for.
* @param {module:workbox-strategies.StrategyHandler} handler The event that
* @param {workbox-strategies.StrategyHandler} handler The event that
* triggered the request.

@@ -65,0 +65,0 @@ * @return {Promise<Response>}

@@ -49,3 +49,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -58,3 +58,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -69,3 +69,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -87,3 +87,3 @@

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
// @ts-ignore
try{self['workbox:precaching:6.4.2']&&_()}catch(e){}
try{self['workbox:precaching:6.5.0']&&_()}catch(e){}

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -21,0 +21,0 @@ function addPlugins(plugins: WorkboxPlugin[]): void {

@@ -26,6 +26,6 @@ /*

*
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
* options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -32,0 +32,0 @@ function addRoute(options?: PrecacheRouteOptions): void {

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

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -21,0 +21,0 @@ function cleanupOutdatedCaches(): void {

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

* response from the network if there's a precache miss.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -31,0 +31,0 @@ function createHandlerBoundToURL(url: string): RouteHandlerCallback {

@@ -29,3 +29,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -32,0 +32,0 @@ function getCacheKeyForURL(url: string): string | undefined {

@@ -26,3 +26,3 @@ /*

* Most consumers of this module will want to use the
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}
* {@link workbox-precaching.precacheAndRoute}
* method to add assets to the cache and respond to network requests with these

@@ -32,3 +32,3 @@ * cached assets.

* If you require more control over caching and routing, you can use the
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* interface.

@@ -35,0 +35,0 @@ *

@@ -26,3 +26,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -29,0 +29,0 @@ function matchPrecache(

@@ -16,3 +16,3 @@ /*

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -24,10 +24,10 @@ *

* It only precaches files. To respond to a network request you call
* [addRoute()]{@link module:workbox-precaching.addRoute}.
* {@link workbox-precaching.addRoute}.
*
* If you have a single array of files to precache, you can just call
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
* {@link workbox-precaching.precacheAndRoute}.
*
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -34,0 +34,0 @@ function precache(entries: Array<PrecacheEntry | string>): void {

@@ -19,10 +19,10 @@ /*

* This is a convenience method that will call
* [precache()]{@link module:workbox-precaching.precache} and
* [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.
* {@link workbox-precaching.precache} and
* {@link workbox-precaching.addRoute} in a single call.
*
* @param {Array<Object|string>} entries Array of entries to precache.
* @param {Object} [options] See
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
* @param {Object} [options] See the
* {@link workbox-precaching.PrecacheRoute} options.
*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -29,0 +29,0 @@ function precacheAndRoute(

@@ -44,3 +44,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -92,3 +92,3 @@ class PrecacheController {

/**
* @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
* used to cache assets and respond to fetch events.

@@ -103,3 +103,3 @@ */

* stores the files in the
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
* {@link workbox-core.cacheNames|"precache cache"} when the service
* worker installs.

@@ -125,3 +125,3 @@ *

*
* @param {Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
* Array of entries to precache.

@@ -201,3 +201,3 @@ */

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.InstallResult>}
* @return {Promise<workbox-precaching.InstallResult>}
*/

@@ -250,3 +250,3 @@ install(event: ExtendableEvent): Promise<InstallResult> {

* @param {ExtendableEvent} event
* @return {Promise<module:workbox-precaching.CleanupResult>}
* @return {Promise<workbox-precaching.CleanupResult>}
*/

@@ -356,3 +356,3 @@ activate(event: ExtendableEvent): Promise<CleanupResult> {

* `Response`.
* @return {module:workbox-routing~handlerCallback}
* @return {workbox-routing~handlerCallback}
*/

@@ -359,0 +359,0 @@ createHandlerBoundToURL(url: string): RouteHandlerCallback {

@@ -28,3 +28,3 @@ /*

*
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -31,0 +31,0 @@ class PrecacheFallbackPlugin implements WorkboxPlugin {

@@ -24,9 +24,9 @@ /*

/**
* A subclass of [Route]{@link module:workbox-routing.Route} that takes a
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* A subclass of {@link workbox-routing.Route} that takes a
* {@link workbox-precaching.PrecacheController}
* instance and uses it to match incoming requests and handle fetching
* responses from the precache.
*
* @memberof module:workbox-precaching
* @extends module:workbox-routing.Route
* @memberof workbox-precaching
* @extends workbox-routing.Route
*/

@@ -46,3 +46,3 @@ class PrecacheRoute extends Route {

* check the cache for the URL with a `.html` added to the end of the end.
* @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]
* @param {workbox-precaching~urlManipulation} [options.urlManipulation]
* This is a function that should take a URL and return an array of

@@ -49,0 +49,0 @@ * alternative URLs that should be checked for precache matches.

@@ -25,5 +25,5 @@ /*

/**
* A [Strategy]{@link module:workbox-strategies.Strategy} implementation
* A {@link workbox-strategies.Strategy} implementation
* specifically designed to work with
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
* {@link workbox-precaching.PrecacheController}
* to both cache and fetch precached assets.

@@ -34,4 +34,4 @@ *

*
* @extends module:workbox-strategies.Strategy
* @memberof module:workbox-precaching
* @extends workbox-strategies.Strategy
* @memberof workbox-precaching
*/

@@ -62,10 +62,10 @@ class PrecacheStrategy extends Strategy {

* requests. Defaults to the cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* {@link workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
* {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
* of all fetch() requests made by this strategy.
* @param {Object} [options.matchOptions] The
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
* {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
* for any `cache.match()` or `cache.put()` calls made by this strategy.

@@ -92,3 +92,3 @@ * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to

* @param {Request|string} request A request to run this strategy for.
* @param {module:workbox-strategies.StrategyHandler} handler The event that
* @param {workbox-strategies.StrategyHandler} handler The event that
* triggered the request.

@@ -95,0 +95,0 @@ * @return {Promise<Response>}

@@ -28,3 +28,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -31,0 +31,0 @@ export function createCacheKey(entry: PrecacheEntry | string): CacheKey {

@@ -32,3 +32,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -35,0 +35,0 @@ const deleteOutdatedCaches = async (

@@ -21,3 +21,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -24,0 +24,0 @@ export function* generateURLVariations(

@@ -32,3 +32,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -35,0 +35,0 @@ export function printCleanupDetails(deletedURLs: string[]): void {

@@ -37,3 +37,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -40,0 +40,0 @@ export function printInstallDetails(

@@ -21,3 +21,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -24,0 +24,0 @@ export function removeIgnoredSearchParams(

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
export declare function createCacheKey(entry: PrecacheEntry | string): CacheKey;
export {};

@@ -19,3 +19,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -22,0 +22,0 @@ export function createCacheKey(entry) {

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
declare const deleteOutdatedCaches: (currentPrecacheName: string, substringToFind?: string) => Promise<string[]>;
export { deleteOutdatedCaches };

@@ -26,3 +26,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -29,0 +29,0 @@ const deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {

@@ -11,4 +11,4 @@ import { PrecacheRouteOptions } from '../_types.js';

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
export declare function generateURLVariations(url: string, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, }?: PrecacheRouteOptions): Generator<string, void, unknown>;

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -21,0 +21,0 @@ export function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
export declare function printCleanupDetails(deletedURLs: string[]): void;

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -30,0 +30,0 @@ export function printCleanupDetails(deletedURLs) {

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
export declare function printInstallDetails(urlsToPrecache: string[], urlsAlreadyPrecached: string[]): void;

@@ -31,3 +31,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -34,0 +34,0 @@ export function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {

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

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/
export declare function removeIgnoredSearchParams(urlObject: URL, ignoreURLParametersMatching?: RegExp[]): URL;

@@ -19,3 +19,3 @@ /*

* @private
* @memberof module:workbox-precaching
* @memberof workbox-precaching
*/

@@ -22,0 +22,0 @@ export function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {

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