summaryrefslogtreecommitdiff
path: root/dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map')
-rw-r--r--dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map1
1 files changed, 0 insertions, 1 deletions
diff --git a/dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map b/dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map
deleted file mode 100644
index 3e3c992..0000000
--- a/dist/workbox-v3.2.0/workbox-cache-expiration.prod.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":[],"mappings":"","sources":["packages/workbox-cache-expiration/browser.mjs"],"sourcesContent":["this.workbox=this.workbox||{},this.workbox.expiration=function(e,t,r,i){\"use strict\";try{self.workbox.v[\"workbox:cache-expiration:3.2.0\"]=1}catch(e){}const n=\"url\",s=\"timestamp\";class a{constructor(e){this.e=e,this.t=e,this.r=new t.DBWrapper(this.e,2,{onupgradeneeded:e=>this.i(e)})}i(e){const t=e.target.result;e.oldVersion<2&&t.objectStoreNames.contains(\"workbox-cache-expiration\")&&t.deleteObjectStore(\"workbox-cache-expiration\"),t.createObjectStore(this.t,{keyPath:n}).createIndex(s,s,{unique:!1})}setTimestamp(e,t){var r=this;return babelHelpers.asyncToGenerator(function*(){yield r.r.put(r.t,{[n]:new URL(e,location).href,[s]:t})})()}getAllTimestamps(){var e=this;return babelHelpers.asyncToGenerator(function*(){return yield e.r.getAllMatching(e.t,{index:s})})()}getTimestamp(e){var t=this;return babelHelpers.asyncToGenerator(function*(){return(yield t.r.get(t.t,e)).timestamp})()}deleteUrl(e){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.r.delete(t.t,new URL(e,location).href)})()}}class o{constructor(e,t={}){this.n=!1,this.s=!1,this.a=t.maxEntries,this.o=t.maxAgeSeconds,this.e=e,this.l=new a(e)}expireEntries(){var e=this;return babelHelpers.asyncToGenerator(function*(){if(e.n)return void(e.s=!0);e.n=!0;const t=Date.now(),r=yield e.c(t),i=yield e.u(),n=[...new Set(r.concat(i))];yield Promise.all([e.h(n),e.d(n)]),e.n=!1,e.s&&(e.s=!1,e.expireEntries())})()}c(e){var t=this;return babelHelpers.asyncToGenerator(function*(){if(!t.o)return[];const r=e-1e3*t.o,i=[];return(yield t.l.getAllTimestamps()).forEach(function(e){e.timestamp<r&&i.push(e.url)}),i})()}u(){var e=this;return babelHelpers.asyncToGenerator(function*(){const t=[];if(!e.a)return[];const r=yield e.l.getAllTimestamps();for(;r.length>e.a;){const e=r.shift();t.push(e.url)}return t})()}h(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const r=yield caches.open(t.e);for(const t of e)yield r.delete(t)})()}d(e){var t=this;return babelHelpers.asyncToGenerator(function*(){for(const r of e)yield t.l.deleteUrl(r)})()}updateTimestamp(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const r=new URL(e,location);r.hash=\"\",yield t.l.setTimestamp(r.href,Date.now())})()}isURLExpired(e){var t=this;return babelHelpers.asyncToGenerator(function*(){if(!t.o)throw new r.WorkboxError(\"expired-test-without-max-age\",{methodName:\"isURLExpired\",paramName:\"maxAgeSeconds\"});const i=new URL(e,location);return i.hash=\"\",(yield t.l.getTimestamp(i.href))<Date.now()-1e3*t.o})()}}return e.CacheExpiration=o,e.Plugin=class{constructor(e={}){this.p=e,this.o=e.maxAgeSeconds,this.f=new Map}b(e){if(e===i.cacheNames.getRuntimeName())throw new r.WorkboxError(\"expire-custom-caches-only\");let t=this.f.get(e);return t||(t=new o(e,this.p),this.f.set(e,t)),t}cachedResponseWillBeUsed({cacheName:e,cachedResponse:t}){if(!t)return null;let r=this.m(t);return this.b(e).expireEntries(),r?t:null}m(e){if(!this.o)return!0;const t=this.w(e);return null===t||t>=Date.now()-1e3*this.o}w(e){if(!e.headers.has(\"date\"))return null;const t=e.headers.get(\"date\"),r=new Date(t).getTime();return isNaN(r)?null:r}cacheDidUpdate({cacheName:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const i=r.b(e);yield i.updateTimestamp(t.url),yield i.expireEntries()})()}},e}({},workbox.core._private,workbox.core._private,workbox.core._private);\n"],"file":"workbox-cache-expiration.prod.js"} \ No newline at end of file