diff options
| author | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-11-21 22:00:30 +0000 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-11-21 22:00:30 +0000 |
| commit | 6ec00afac5afc892dca5a184b66467d9408f14a5 (patch) | |
| tree | 6440bf43eafdf75a376b94b9636f3ccac7b3f716 /public/idb-keyval-3.2.0-iife.min.js | |
| parent | 7fede4ee94880f09f44697104c0696e44fc2f8b6 (diff) | |
| download | submelon.dev-6ec00afac5afc892dca5a184b66467d9408f14a5.tar.gz submelon.dev-6ec00afac5afc892dca5a184b66467d9408f14a5.tar.bz2 submelon.dev-6ec00afac5afc892dca5a184b66467d9408f14a5.zip | |
chore: autopublish 2022-11-21T22:00:30Z
Diffstat (limited to 'public/idb-keyval-3.2.0-iife.min.js')
| -rw-r--r-- | public/idb-keyval-3.2.0-iife.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/public/idb-keyval-3.2.0-iife.min.js b/public/idb-keyval-3.2.0-iife.min.js new file mode 100644 index 0000000..067a966 --- /dev/null +++ b/public/idb-keyval-3.2.0-iife.min.js @@ -0,0 +1 @@ +var idbKeyval=function(e){"use strict";class t{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbp=new Promise((r,n)=>{const o=indexedDB.open(e,1);o.onerror=(()=>n(o.error)),o.onsuccess=(()=>r(o.result)),o.onupgradeneeded=(()=>{o.result.createObjectStore(t)})})}_withIDBStore(e,t){return this._dbp.then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,e);s.oncomplete=(()=>n()),s.onabort=s.onerror=(()=>o(s.error)),t(s.objectStore(this.storeName))}))}}let r;function n(){return r||(r=new t),r}return e.Store=t,e.get=function(e,t=n()){let r;return t._withIDBStore("readonly",t=>{r=t.get(e)}).then(()=>r.result)},e.set=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{r.put(t,e)})},e.del=function(e,t=n()){return t._withIDBStore("readwrite",t=>{t.delete(e)})},e.clear=function(e=n()){return e._withIDBStore("readwrite",e=>{e.clear()})},e.keys=function(e=n()){const t=[];return e._withIDBStore("readonly",e=>{(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},e}({});
\ No newline at end of file |
