workbox-strategies
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:strategies:3.5.0'] = 1; | ||
self.workbox.v['workbox:strategies:3.6.0'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -94,4 +94,4 @@ | ||
* | ||
* @param {Object} input | ||
* @param {FetchEvent} input.event The fetch event to run this strategy | ||
* @param {Object} options | ||
* @param {FetchEvent} options.event The fetch event to run this strategy | ||
* against. | ||
@@ -127,8 +127,8 @@ * @return {Promise<Response>} | ||
* | ||
* @param {Object} input | ||
* @param {Request|string} input.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be | ||
* called automatically to extend the service worker's lifetime. | ||
* @param {Object} options | ||
* @param {Request|string} options.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [options.event] If provided, `event.waitUntil()` will | ||
be called automatically to extend the service worker's lifetime. | ||
* @return {Promise<Response>} | ||
@@ -155,3 +155,9 @@ */ | ||
let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins); | ||
let response = yield cacheWrapper_mjs.cacheWrapper.match({ | ||
cacheName: _this2._cacheName, | ||
request, | ||
event, | ||
matchOptions: _this2._matchOptions, | ||
plugins: _this2._plugins | ||
}); | ||
@@ -214,7 +220,18 @@ let error; | ||
return babelHelpers.asyncToGenerator(function* () { | ||
const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins, event ? event.preloadResponse : undefined); | ||
const response = yield fetchWrapper_mjs.fetchWrapper.fetch({ | ||
request, | ||
event, | ||
fetchOptions: _this3._fetchOptions, | ||
plugins: _this3._plugins | ||
}); | ||
// Keep the service worker while we put the request to the cache | ||
const responseClone = response.clone(); | ||
const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, responseClone, _this3._plugins); | ||
const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put({ | ||
cacheName: _this3._cacheName, | ||
request, | ||
response: responseClone, | ||
event, | ||
plugins: _this3._plugins | ||
}); | ||
@@ -281,4 +298,4 @@ if (event) { | ||
* | ||
* @param {Object} input | ||
* @param {FetchEvent} input.event The fetch event to run this strategy | ||
* @param {Object} options | ||
* @param {FetchEvent} options.event The fetch event to run this strategy | ||
* against. | ||
@@ -314,8 +331,8 @@ * @return {Promise<Response>} | ||
* | ||
* @param {Object} input | ||
* @param {Request|string} input.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be | ||
* called automatically to extend the service worker's lifetime. | ||
* @param {Object} options | ||
* @param {Request|string} options.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [options.event] If provided, `event.waitUntil()` will | ||
* be called automatically to extend the service worker's lifetime. | ||
* @return {Promise<Response>} | ||
@@ -340,3 +357,9 @@ */ | ||
const response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins); | ||
const response = yield cacheWrapper_mjs.cacheWrapper.match({ | ||
cacheName: _this2._cacheName, | ||
request, | ||
event, | ||
matchOptions: _this2._matchOptions, | ||
plugins: _this2._plugins | ||
}); | ||
@@ -379,4 +402,4 @@ { | ||
* | ||
* @param {Object} input | ||
* @param {Response} input.response | ||
* @param {Object} options | ||
* @param {Response} options.response | ||
* @return {Response|null} | ||
@@ -472,4 +495,4 @@ * | ||
* | ||
* @param {Object} input | ||
* @param {FetchEvent} input.event The fetch event to run this strategy | ||
* @param {Object} options | ||
* @param {FetchEvent} options.event The fetch event to run this strategy | ||
* against. | ||
@@ -505,8 +528,8 @@ * @return {Promise<Response>} | ||
* | ||
* @param {Object} input | ||
* @param {Request|string} input.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be | ||
* called automatically to extend the service worker's lifetime. | ||
* @param {Object} options | ||
* @param {Request|string} options.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [options.event] If provided, `event.waitUntil()` will | ||
* be called automatically to extend the service worker's lifetime. | ||
* @return {Promise<Response>} | ||
@@ -537,3 +560,3 @@ */ | ||
if (_this2._networkTimeoutSeconds) { | ||
const { id, promise } = _this2._getTimeoutPromise(request, logs); | ||
const { id, promise } = _this2._getTimeoutPromise({ request, event, logs }); | ||
timeoutId = id; | ||
@@ -543,3 +566,3 @@ promises.push(promise); | ||
const networkPromise = _this2._getNetworkPromise(timeoutId, event, request, logs); | ||
const networkPromise = _this2._getNetworkPromise({ timeoutId, request, event, logs }); | ||
promises.push(networkPromise); | ||
@@ -572,4 +595,6 @@ | ||
/** | ||
* @param {Request} request | ||
* @param {Array} logs A reference to the logs array | ||
* @param {Object} options | ||
* @param {Request} options.request | ||
* @param {Array} options.logs A reference to the logs array | ||
* @param {Event} [options.event] | ||
* @return {Promise<Response>} | ||
@@ -579,3 +604,3 @@ * | ||
*/ | ||
_getTimeoutPromise(request, logs) { | ||
_getTimeoutPromise({ request, logs, event }) { | ||
var _this3 = this; | ||
@@ -591,3 +616,3 @@ | ||
resolve((yield _this3._respondFromCache(request))); | ||
resolve((yield _this3._respondFromCache({ request, event }))); | ||
}); | ||
@@ -610,6 +635,7 @@ | ||
/** | ||
* @param {number} timeoutId | ||
* @param {FetchEvent|null} event | ||
* @param {Request} request | ||
* @param {Array} logs A reference to the logs Array. | ||
* @param {Object} options | ||
* @param {number|undefined} options.timeoutId | ||
* @param {Request} options.request | ||
* @param {Array} options.logs A reference to the logs Array. | ||
* @param {Event} [options.event] | ||
* @return {Promise<Response>} | ||
@@ -619,3 +645,3 @@ * | ||
*/ | ||
_getNetworkPromise(timeoutId, event, request, logs) { | ||
_getNetworkPromise({ timeoutId, request, logs, event }) { | ||
var _this4 = this; | ||
@@ -627,3 +653,8 @@ | ||
try { | ||
response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this4._fetchOptions, _this4._plugins, event ? event.preloadResponse : undefined); | ||
response = yield fetchWrapper_mjs.fetchWrapper.fetch({ | ||
request, | ||
event, | ||
fetchOptions: _this4._fetchOptions, | ||
plugins: _this4._plugins | ||
}); | ||
} catch (err) { | ||
@@ -646,3 +677,3 @@ error = err; | ||
if (error || !response) { | ||
response = yield _this4._respondFromCache(request); | ||
response = yield _this4._respondFromCache({ request, event }); | ||
{ | ||
@@ -658,3 +689,9 @@ if (response) { | ||
const responseClone = response.clone(); | ||
const cachePut = cacheWrapper_mjs.cacheWrapper.put(_this4._cacheName, request, responseClone, _this4._plugins); | ||
const cachePut = cacheWrapper_mjs.cacheWrapper.put({ | ||
cacheName: _this4._cacheName, | ||
request, | ||
response: responseClone, | ||
event, | ||
plugins: _this4._plugins | ||
}); | ||
@@ -681,3 +718,5 @@ if (event) { | ||
* | ||
* @param {Request} request The fetchEvent request to match in the cache | ||
* @param {Object} options | ||
* @param {Request} request The request to match in the cache | ||
* @param {Event} [options.event] | ||
* @return {Promise<Object>} | ||
@@ -687,4 +726,10 @@ * | ||
*/ | ||
_respondFromCache(request) { | ||
return cacheWrapper_mjs.cacheWrapper.match(this._cacheName, request, this._matchOptions, this._plugins); | ||
_respondFromCache({ event, request }) { | ||
return cacheWrapper_mjs.cacheWrapper.match({ | ||
cacheName: this._cacheName, | ||
request, | ||
event, | ||
matchOptions: this._matchOptions, | ||
plugins: this._plugins | ||
}); | ||
} | ||
@@ -740,4 +785,4 @@ } | ||
* | ||
* @param {Object} input | ||
* @param {FetchEvent} input.event The fetch event to run this strategy | ||
* @param {Object} options | ||
* @param {FetchEvent} options.event The fetch event to run this strategy | ||
* against. | ||
@@ -773,8 +818,8 @@ * @return {Promise<Response>} | ||
* | ||
* @param {Object} input | ||
* @param {Request|string} input.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be | ||
* called automatically to extend the service worker's lifetime. | ||
* @param {Object} options | ||
* @param {Request|string} options.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [options.event] If provided, `event.waitUntil()` will | ||
* be called automatically to extend the service worker's lifetime. | ||
* @return {Promise<Response>} | ||
@@ -802,3 +847,8 @@ */ | ||
try { | ||
response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this2._fetchOptions, _this2._plugins, event ? event.preloadResponse : undefined); | ||
response = yield fetchWrapper_mjs.fetchWrapper.fetch({ | ||
request, | ||
event, | ||
fetchOptions: _this2._fetchOptions, | ||
plugins: _this2._plugins | ||
}); | ||
} catch (err) { | ||
@@ -896,4 +946,4 @@ error = err; | ||
* | ||
* @param {Object} input | ||
* @param {FetchEvent} input.event The fetch event to run this strategy | ||
* @param {Object} options | ||
* @param {FetchEvent} options.event The fetch event to run this strategy | ||
* against. | ||
@@ -929,8 +979,8 @@ * @return {Promise<Response>} | ||
* | ||
* @param {Object} input | ||
* @param {Request|string} input.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be | ||
* called automatically to extend the service worker's lifetime. | ||
* @param {Object} options | ||
* @param {Request|string} options.request Either a | ||
* [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request} | ||
* object, or a string URL, corresponding to the request to be made. | ||
* @param {FetchEvent} [options.event] If provided, `event.waitUntil()` will | ||
* be called automatically to extend the service worker's lifetime. | ||
* @return {Promise<Response>} | ||
@@ -957,5 +1007,11 @@ */ | ||
const fetchAndCachePromise = _this2._getFromNetwork(request, event); | ||
const fetchAndCachePromise = _this2._getFromNetwork({ request, event }); | ||
let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins); | ||
let response = yield cacheWrapper_mjs.cacheWrapper.match({ | ||
cacheName: _this2._cacheName, | ||
request, | ||
event, | ||
matchOptions: _this2._matchOptions, | ||
plugins: _this2._plugins | ||
}); | ||
@@ -997,4 +1053,5 @@ if (response) { | ||
/** | ||
* @param {Request} request | ||
* @param {FetchEvent} [event] | ||
* @param {Object} options | ||
* @param {Request} options.request | ||
* @param {Event} [options.event] | ||
* @return {Promise<Response>} | ||
@@ -1004,9 +1061,20 @@ * | ||
*/ | ||
_getFromNetwork(request, event) { | ||
_getFromNetwork({ request, event }) { | ||
var _this3 = this; | ||
return babelHelpers.asyncToGenerator(function* () { | ||
const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins, event ? event.preloadResponse : undefined); | ||
const response = yield fetchWrapper_mjs.fetchWrapper.fetch({ | ||
request, | ||
event, | ||
fetchOptions: _this3._fetchOptions, | ||
plugins: _this3._plugins | ||
}); | ||
const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, response.clone(), _this3._plugins); | ||
const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put({ | ||
cacheName: _this3._cacheName, | ||
request, | ||
response: response.clone(), | ||
event, | ||
plugins: _this3._plugins | ||
}); | ||
@@ -1013,0 +1081,0 @@ if (event) { |
@@ -1,3 +0,3 @@ | ||
this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,r){"use strict";try{self.workbox.v["workbox:strategies:3.5.0"]=1}catch(e){}class s{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));let n,i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(!i)try{i=yield s.n(r,e)}catch(e){n=e}if(n)throw n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=i.clone(),u=t.cacheWrapper.put(n.e,e,l,n.t);if(s)try{s.waitUntil(u)}catch(e){}return i})()}}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){return"string"==typeof r&&(r=new Request(r)),yield t.cacheWrapper.match(s.e,r,s.s,s.t)})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class l{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.i=t.networkTimeoutSeconds,this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const s=[];"string"==typeof t&&(t=new Request(t));const n=[];let i;if(r.i){const{id:e,promise:l}=r.l(t,s);i=e,n.push(l)}const l=r.u(i,e,t,s);n.push(l);let u=yield Promise.race(n);return u||(u=yield l),u})()}l(e,t){var r=this;let s;var n;return{promise:new Promise(t=>{const i=(n=babelHelpers.asyncToGenerator(function*(){t(yield r.o(e))}),function(){return n.apply(this,arguments)});s=setTimeout(i,1e3*this.i)}),id:s}}u(e,s,n,i){var l=this;return babelHelpers.asyncToGenerator(function*(){let i,u;try{u=yield r.fetchWrapper.fetch(n,l.r,l.t,s?s.preloadResponse:void 0)}catch(e){i=e}if(e&&clearTimeout(e),i||!u)u=yield l.o(n);else{const e=u.clone(),r=t.cacheWrapper.put(l.e,n,e,l.t);if(s)try{s.waitUntil(r)}catch(e){}}return u})()}o(e){return t.cacheWrapper.match(this.e,e,this.s,this.t)}}class u{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var s=this;return babelHelpers.asyncToGenerator(function*(){let n,i;"string"==typeof t&&(t=new Request(t));try{i=yield r.fetchWrapper.fetch(t,s.r,s.t,e?e.preloadResponse:void 0)}catch(e){n=e}if(n)throw n;return i})()}}class o{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));const n=s.n(r,e);let i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(i){if(e)try{e.waitUntil(n)}catch(e){}}else i=yield n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=t.cacheWrapper.put(n.e,e,i.clone(),n.t);if(s)try{s.waitUntil(l)}catch(e){}return i})()}}var c=Object.freeze({CacheFirst:s,CacheOnly:n,NetworkFirst:l,NetworkOnly:u,StaleWhileRevalidate:o});const a={cacheFirst:s,cacheOnly:n,networkFirst:l,networkOnly:u,staleWhileRevalidate:o},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,c)}(workbox.core._private,workbox.core._private,workbox.core._private); | ||
this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,s){"use strict";try{self.workbox.v["workbox:strategies:3.6.0"]=1}catch(e){}class r{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.s=t.fetchOptions||null,this.r=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:s}){var r=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof s&&(s=new Request(s));let n,i=yield t.cacheWrapper.match({cacheName:r.e,request:s,event:e,matchOptions:r.r,plugins:r.t});if(!i)try{i=yield r.n(s,e)}catch(e){n=e}if(n)throw n;return i})()}n(e,r){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield s.fetchWrapper.fetch({request:e,event:r,fetchOptions:n.s,plugins:n.t}),u=i.clone(),l=t.cacheWrapper.put({cacheName:n.e,request:e,response:u,event:r,plugins:n.t});if(r)try{r.waitUntil(l)}catch(e){}return i})()}}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:s}){var r=this;return babelHelpers.asyncToGenerator(function*(){return"string"==typeof s&&(s=new Request(s)),yield t.cacheWrapper.match({cacheName:r.e,request:s,event:e,matchOptions:r.r,plugins:r.t})})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class u{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.i=t.networkTimeoutSeconds,this.s=t.fetchOptions||null,this.r=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var s=this;return babelHelpers.asyncToGenerator(function*(){const r=[];"string"==typeof t&&(t=new Request(t));const n=[];let i;if(s.i){const{id:u,promise:l}=s.u({request:t,event:e,logs:r});i=u,n.push(l)}const u=s.l({timeoutId:i,request:t,event:e,logs:r});n.push(u);let l=yield Promise.race(n);return l||(l=yield u),l})()}u({request:e,logs:t,event:s}){var r=this;let n;var i;return{promise:new Promise(t=>{const u=(i=babelHelpers.asyncToGenerator(function*(){t(yield r.c({request:e,event:s}))}),function(){return i.apply(this,arguments)});n=setTimeout(u,1e3*this.i)}),id:n}}l({timeoutId:e,request:r,logs:n,event:i}){var u=this;return babelHelpers.asyncToGenerator(function*(){let n,l;try{l=yield s.fetchWrapper.fetch({request:r,event:i,fetchOptions:u.s,plugins:u.t})}catch(e){n=e}if(e&&clearTimeout(e),n||!l)l=yield u.c({request:r,event:i});else{const e=l.clone(),s=t.cacheWrapper.put({cacheName:u.e,request:r,response:e,event:i,plugins:u.t});if(i)try{i.waitUntil(s)}catch(e){}}return l})()}c({event:e,request:s}){return t.cacheWrapper.match({cacheName:this.e,request:s,event:e,matchOptions:this.r,plugins:this.t})}}class l{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.s=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){let n,i;"string"==typeof t&&(t=new Request(t));try{i=yield s.fetchWrapper.fetch({request:t,event:e,fetchOptions:r.s,plugins:r.t})}catch(e){n=e}if(n)throw n;return i})()}}class c{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.s=t.fetchOptions||null,this.r=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:s}){var r=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof s&&(s=new Request(s));const n=r.n({request:s,event:e});let i=yield t.cacheWrapper.match({cacheName:r.e,request:s,event:e,matchOptions:r.r,plugins:r.t});if(i){if(e)try{e.waitUntil(n)}catch(e){}}else i=yield n;return i})()}n({request:e,event:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield s.fetchWrapper.fetch({request:e,event:r,fetchOptions:n.s,plugins:n.t}),u=t.cacheWrapper.put({cacheName:n.e,request:e,response:i.clone(),event:r,plugins:n.t});if(r)try{r.waitUntil(u)}catch(e){}return i})()}}var o=Object.freeze({CacheFirst:r,CacheOnly:n,NetworkFirst:u,NetworkOnly:l,StaleWhileRevalidate:c});const a={cacheFirst:r,cacheOnly:n,networkFirst:u,networkOnly:l,staleWhileRevalidate:c},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,o)}(workbox.core._private,workbox.core._private,workbox.core._private); | ||
//# sourceMappingURL=workbox-strategies.prod.js.map |
{ | ||
"name": "workbox-strategies", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"license": "Apache-2.0", | ||
@@ -30,4 +30,4 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-core": "^3.5.0" | ||
"workbox-core": "^3.6.0" | ||
} | ||
} |
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
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
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
134738
2145
1
Updatedworkbox-core@^3.6.0