workbox-core
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -43,3 +43,3 @@ /* eslint-disable */ | ||
try { | ||
self.workbox.v['workbox:core:3.1.0'] = 1; | ||
self.workbox.v['workbox:core:3.2.0'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -685,4 +685,5 @@ | ||
defaultExport.groupCollapsed('Welcome to Workbox!'); | ||
defaultExport.unprefixed.log(`You are currently using a development build. ` + `By default this will switch to prod builds when not on localhost. ` + `You can force this with workbox.setConfig({debug: true|false}).`); | ||
defaultExport.unprefixed.log(`📖 Read the guides and documentation\n` + `${padding}https://developers.google.com/web/tools/workbox/`); | ||
defaultExport.unprefixed.log(`❓ Use the [workbox] tag on StackOverflow to ask questions\n` + `${padding}https://stackoverflow.com/questions/ask?tags=workbox`); | ||
defaultExport.unprefixed.log(`❓ Use the [workbox] tag on Stack Overflow to ask questions\n` + `${padding}https://stackoverflow.com/questions/ask?tags=workbox`); | ||
defaultExport.unprefixed.log(`🐛 Found a bug? Report it on GitHub\n` + `${padding}https://github.com/GoogleChrome/workbox/issues/new`); | ||
@@ -689,0 +690,0 @@ defaultExport.groupEnd(); |
@@ -1,3 +0,3 @@ | ||
self.babelHelpers={asyncToGenerator:function(e){return function(){var r=e.apply(this,arguments);return new Promise(function(e,t){return function n(o,i){try{var l=r[o](i),c=l.value}catch(e){return void t(e)}if(!l.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}("next")})}}},this.workbox=this.workbox||{},this.workbox.core=function(){"use strict";try{self.workbox.v["workbox:core:3.1.0"]=1}catch(e){}var e={debug:0,log:1,warn:2,error:3,silent:4};const r=(e,...r)=>{let t=e;return r.length>0&&(t+=` :: ${JSON.stringify(r)}`),t};class t extends Error{constructor(e,t){let n=r(e,t);super(n),this.name=e,this.details=t}}const n={prefix:"workbox",suffix:self.registration.scope,googleAnalytics:"googleAnalytics",precache:"precache",runtime:"runtime"},o=e=>[n.prefix,e,n.suffix].filter(e=>e.length>0).join("-"),i={updateDetails:e=>{Object.keys(n).forEach(r=>{void 0!==e[r]&&(n[r]=e[r])})},getGoogleAnalyticsName:e=>e||o(n.googleAnalytics),getPrecacheName:e=>e||o(n.precache),getRuntimeName:e=>e||o(n.runtime)},l=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let c=e.warn;const s=e=>c<=e,u=e=>c=e,a=()=>c,f=e.error,d=function(r,t,n){const o=0===r.indexOf("group")?f:e[r];if(!s(o))return;if(!n||"groupCollapsed"===r&&l)return void console[r](...t);const i=["%cworkbox",`background: ${n}; color: white; padding: 2px 0.5em; `+"border-radius: 0.5em;"];console[r](...i,...t)},h=()=>{s(f)&&console.groupEnd()},p={groupEnd:h,unprefixed:{groupEnd:h}},y={debug:"#7f8c8d",log:"#2ecc71",warn:"#f39c12",error:"#c0392b",groupCollapsed:"#3498db"};Object.keys(y).forEach(e=>(b=e,g=y[e],p[b]=((...e)=>d(b,e,g)),void(p.unprefixed[b]=((...e)=>d(b,e)))));var b,g;var v=new class{constructor(){try{self.workbox.v=self.workbox.v||{}}catch(e){}}get cacheNames(){return{googleAnalytics:i.getGoogleAnalyticsName(),precache:i.getPrecacheName(),runtime:i.getRuntimeName()}}setCacheNameDetails(e){i.updateDetails(e)}get logLevel(){return a()}setLogLevel(r){if(r>e.silent||r<e.debug)throw new t("invalid-value",{paramName:"logLevel",validValueDescription:"Please use a value from LOG_LEVELS, i.e 'logLevel = workbox.core.LOG_LEVELS.debug'.",value:r});u(r)}};const w=e=>{const r=new URL(e,location);return r.origin===location.origin?r.pathname:r.href};var m="cacheDidUpdate",L="cacheWillUpdate",E="cachedResponseWillBeUsed",H="fetchDidFail",x="requestWillFetch",q=(e,r)=>e.filter(e=>r in e);const N=(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,n,o=[]){if(!n)throw new t("cache-put-with-no-response",{url:w(r.url)});let i=yield k(r,n,o);if(!i)return;const l=yield caches.open(e),c=q(o,m);let s=c.length>0?yield O(e,r):null;yield l.put(r,i);for(let t of c)yield t[m].call(t,{cacheName:e,request:r,oldResponse:s,newResponse:i})});return function(r,t,n){return e.apply(this,arguments)}})(),O=(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,t,n=[]){let o=yield(yield caches.open(e)).match(r,t);for(let i of n)E in i&&(o=yield i[E].call(i,{cacheName:e,request:r,matchOptions:t,cachedResponse:o}));return o});return function(r,t,n){return e.apply(this,arguments)}})(),k=(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,t){let n=r,o=!1;for(let r of t)if(L in r&&(o=!0,!(n=yield r[L].call(r,{request:e,response:n}))))break;return o||(n=n.ok?n:null),n||null});return function(r,t,n){return e.apply(this,arguments)}})(),R={put:N,match:O},A={fetch:(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,n=[]){"string"==typeof e&&(e=new Request(e));const o=q(n,H),i=o.length>0?e.clone():null;try{for(let r of n)x in r&&(e=yield r[x].call(r,{request:e.clone()}))}catch(e){throw new t("plugin-error-request-will-fetch",{thrownError:e})}const l=e.clone();try{return yield fetch(e,r)}catch(e){for(let e of o)yield e[H].call(e,{originalRequest:i.clone(),request:l.clone()});throw e}});return function(r,t){return e.apply(this,arguments)}})()};class D{constructor(e,r,{onupgradeneeded:t,onversionchange:n=this.e}={}){this.r=e,this.t=r,this.n=t,this.e=n,this.o=null}open(){var e=this;return babelHelpers.asyncToGenerator(function*(){if(!e.o)return e.o=yield new Promise(function(r,t){let n=!1;setTimeout(function(){n=!0,t(new Error("The open request was blocked and timed out"))},e.OPEN_TIMEOUT);const o=indexedDB.open(e.r,e.t);o.onerror=function(e){return t(o.error)},o.onupgradeneeded=function(r){n?(o.transaction.abort(),r.target.result.close()):e.n&&e.n(r)},o.onsuccess=function(t){const o=t.target.result;n?o.close():(o.onversionchange=e.e,r(o))}}),e})()}get(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("get",e,"readonly",...r)})()}add(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("add",e,"readwrite",...r)})()}put(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("put",e,"readwrite",...r)})()}delete(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.i("delete",e,"readwrite",...r)})()}getAll(e,r,t){var n=this;return babelHelpers.asyncToGenerator(function*(){return"getAll"in IDBObjectStore.prototype?yield n.i("getAll",e,"readonly",r,t):yield n.getAllMatching(e,{query:r,count:t})})()}getAllMatching(e,r={}){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.transaction([e],"readonly",function(t,n){const o=t[e],i=[];(r.index?o.index(r.index):o).openCursor(r.query,r.direction).onsuccess=function(e){const t=e.target.result;if(t){const{primaryKey:e,key:o,value:l}=t;i.push(r.includeKeys?{primaryKey:e,key:o,value:l}:l),r.count&&i.length>=r.count?n(i):t.continue()}else n(i)}})})()}transaction(e,r,t){var n=this;return babelHelpers.asyncToGenerator(function*(){yield n.open();return yield new Promise(function(o,i){const l=n.o.transaction(e,r);l.onerror=function(e){return i(e.target.error)},l.onabort=function(e){return i(e.target.error)},l.oncomplete=function(){return o()};const c={};for(const r of e)c[r]=l.objectStore(r);t(c,function(e){return o(e)},function(){i(new Error("The transaction was manually aborted")),l.abort()})})})()}i(e,r,t,...n){var o=this;return babelHelpers.asyncToGenerator(function*(){yield o.open();return yield o.transaction([r],t,function(t,o){t[r][e](...n).onsuccess=function(e){o(e.target.result)}})})()}e(e){this.close()}close(){this.o&&this.o.close()}}D.prototype.OPEN_TIMEOUT=2e3;var W=Object.freeze({logger:p,assert:null,cacheNames:i,cacheWrapper:R,fetchWrapper:A,WorkboxError:t,DBWrapper:D,getFriendlyURL:w});return Object.assign(v,{LOG_LEVELS:e,_private:W})}(); | ||
self.babelHelpers={asyncToGenerator:function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,i){try{var c=t[o](i),l=c.value}catch(e){return void r(e)}if(!c.done)return Promise.resolve(l).then(function(e){n("next",e)},function(e){n("throw",e)});e(l)}("next")})}}},this.workbox=this.workbox||{},this.workbox.core=function(){"use strict";try{self.workbox.v["workbox:core:3.2.0"]=1}catch(e){}var e={debug:0,log:1,warn:2,error:3,silent:4};const t=(e,...t)=>{let r=e;return t.length>0&&(r+=` :: ${JSON.stringify(t)}`),r};class r extends Error{constructor(e,r){super(t(e,r)),this.name=e,this.details=r}}const n={prefix:"workbox",suffix:self.registration.scope,googleAnalytics:"googleAnalytics",precache:"precache",runtime:"runtime"},o=e=>[n.prefix,e,n.suffix].filter(e=>e.length>0).join("-"),i={updateDetails:e=>{Object.keys(n).forEach(t=>{void 0!==e[t]&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||o(n.googleAnalytics),getPrecacheName:e=>e||o(n.precache),getRuntimeName:e=>e||o(n.runtime)},c=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let l=(()=>e.warn)();const s=e=>l<=e,u=e=>l=e,a=()=>l,f=e.error,d=function(t,r,n){const o=0===t.indexOf("group")?f:e[t];if(!s(o))return;if(!n||"groupCollapsed"===t&&c)return void console[t](...r);const i=["%cworkbox",`background: ${n}; color: white; padding: 2px 0.5em; `+"border-radius: 0.5em;"];console[t](...i,...r)},h=()=>{s(f)&&console.groupEnd()},p={groupEnd:h,unprefixed:{groupEnd:h}},y={debug:"#7f8c8d",log:"#2ecc71",warn:"#f39c12",error:"#c0392b",groupCollapsed:"#3498db"};var b,g;Object.keys(y).forEach(e=>(e=e,g=y[e],p[e]=((...t)=>d(e,t,g)),void(p.unprefixed[e]=((...t)=>d(e,t)))));var v=new class{constructor(){try{self.workbox.v=self.workbox.v||{}}catch(e){}}get cacheNames(){return{googleAnalytics:i.getGoogleAnalyticsName(),precache:i.getPrecacheName(),runtime:i.getRuntimeName()}}setCacheNameDetails(e){i.updateDetails(e)}get logLevel(){return a()}setLogLevel(t){if(t>e.silent||t<e.debug)throw new r("invalid-value",{paramName:"logLevel",validValueDescription:"Please use a value from LOG_LEVELS, i.e 'logLevel = workbox.core.LOG_LEVELS.debug'.",value:t});u(t)}};const w=e=>{const t=new URL(e,location);return t.origin===location.origin?t.pathname:t.href};var m="cacheDidUpdate",L="cacheWillUpdate",E="cachedResponseWillBeUsed",H="fetchDidFail",x="requestWillFetch",q=(e,t)=>e.filter(e=>t in e);const N=(O=babelHelpers.asyncToGenerator(function*(e,t,n,o=[]){if(!n)throw new r("cache-put-with-no-response",{url:w(t.url)});let i=yield A(t,n,o);if(!i)return;const c=yield caches.open(e),l=q(o,m);let s=l.length>0?yield k(e,t):null;yield c.put(t,i);for(let r of l)yield r[m].call(r,{cacheName:e,request:t,oldResponse:s,newResponse:i})}),function(e,t,r){return O.apply(this,arguments)});var O;const k=(R=babelHelpers.asyncToGenerator(function*(e,t,r,n=[]){let o=yield(yield caches.open(e)).match(t,r);for(let i of n)E in i&&(o=yield i[E].call(i,{cacheName:e,request:t,matchOptions:r,cachedResponse:o}));return o}),function(e,t,r){return R.apply(this,arguments)});var R;const A=(D=babelHelpers.asyncToGenerator(function*(e,t,r){let n=t,o=!1;for(let t of r)if(L in t&&(o=!0,!(n=yield t[L].call(t,{request:e,response:n}))))break;return o||(n=n.ok?n:null),n||null}),function(e,t,r){return D.apply(this,arguments)});var D;const W={put:N,match:k},P={fetch:(()=>{var e=babelHelpers.asyncToGenerator(function*(e,t,n=[]){"string"==typeof e&&(e=new Request(e));const o=q(n,H),i=o.length>0?e.clone():null;try{for(let t of n)x in t&&(e=yield t[x].call(t,{request:e.clone()}))}catch(e){throw new r("plugin-error-request-will-fetch",{thrownError:e})}const c=e.clone();try{return yield fetch(e,t)}catch(e){for(let e of o)yield e[H].call(e,{originalRequest:i.clone(),request:c.clone()});throw e}});return function(t,r){return e.apply(this,arguments)}})()};class _{constructor(e,t,{onupgradeneeded:r,onversionchange:n=this.e}={}){this.t=e,this.r=t,this.n=r,this.e=n,this.o=null}open(){var e=this;return babelHelpers.asyncToGenerator(function*(){if(!e.o)return e.o=yield new Promise(function(t,r){let n=!1;setTimeout(function(){n=!0,r(new Error("The open request was blocked and timed out"))},e.OPEN_TIMEOUT);const o=indexedDB.open(e.t,e.r);o.onerror=function(e){return r(o.error)},o.onupgradeneeded=function(t){n?(o.transaction.abort(),t.target.result.close()):e.n&&e.n(t)},o.onsuccess=function(r){const o=r.target.result;n?o.close():(o.onversionchange=e.e,t(o))}}),e})()}get(e,...t){var r=this;return babelHelpers.asyncToGenerator(function*(){return yield r.i("get",e,"readonly",...t)})()}add(e,...t){var r=this;return babelHelpers.asyncToGenerator(function*(){return yield r.i("add",e,"readwrite",...t)})()}put(e,...t){var r=this;return babelHelpers.asyncToGenerator(function*(){return yield r.i("put",e,"readwrite",...t)})()}delete(e,...t){var r=this;return babelHelpers.asyncToGenerator(function*(){yield r.i("delete",e,"readwrite",...t)})()}getAll(e,t,r){var n=this;return babelHelpers.asyncToGenerator(function*(){return"getAll"in IDBObjectStore.prototype?yield n.i("getAll",e,"readonly",t,r):yield n.getAllMatching(e,{query:t,count:r})})()}getAllMatching(e,t={}){var r=this;return babelHelpers.asyncToGenerator(function*(){return yield r.transaction([e],"readonly",function(r,n){const o=r[e],i=[];(t.index?o.index(t.index):o).openCursor(t.query,t.direction).onsuccess=function(e){const r=e.target.result;if(r){const{primaryKey:e,key:o,value:c}=r;i.push(t.includeKeys?{primaryKey:e,key:o,value:c}:c),t.count&&i.length>=t.count?n(i):r.continue()}else n(i)}})})()}transaction(e,t,r){var n=this;return babelHelpers.asyncToGenerator(function*(){return yield n.open(),yield new Promise(function(o,i){const c=n.o.transaction(e,t);c.onerror=function(e){return i(e.target.error)},c.onabort=function(e){return i(e.target.error)},c.oncomplete=function(){return o()};const l={};for(const t of e)l[t]=c.objectStore(t);r(l,function(e){return o(e)},function(){i(new Error("The transaction was manually aborted")),c.abort()})})})()}i(e,t,r,...n){var o=this;return babelHelpers.asyncToGenerator(function*(){yield o.open();return yield o.transaction([t],r,function(r,o){r[t][e](...n).onsuccess=function(e){o(e.target.result)}})})()}e(e){this.close()}close(){this.o&&this.o.close()}}_.prototype.OPEN_TIMEOUT=2e3;var j=Object.freeze({logger:p,assert:null,cacheNames:i,cacheWrapper:W,fetchWrapper:P,WorkboxError:r,DBWrapper:_,getFriendlyURL:w});return Object.assign(v,{LOG_LEVELS:e,_private:j})}(); | ||
//# sourceMappingURL=workbox-core.prod.js.map |
{ | ||
"name": "workbox-core", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "author": "Google's Web DevRel Team", |
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
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
176253
2891