Initial GDevelop project import
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
var gdjs;(function(x){let f;(function(l){l.loadFromIndexedDB=async function(i,e,u){return new Promise((s,n)=>{try{const r=indexedDB.open(i,1);r.onupgradeneeded=function(){const o=r.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},r.onsuccess=function(){const t=r.result.transaction(e,"readonly").objectStore(e).get(u);t.onsuccess=function(){t.result!==void 0?s(t.result):s(null)},t.onerror=function(){console.error("Error loading data from IndexedDB:",t.error),n(t.error)}},r.onerror=function(){console.error("Error opening IndexedDB:",r.error),n(r.error)}}catch(r){console.error("Exception thrown while opening IndexedDB:",r),n(r);return}})},l.saveToIndexedDB=async function(i,e,u,s){return new Promise((n,r)=>{try{const o=indexedDB.open(i,1);o.onupgradeneeded=function(d){const c=o.result;c.objectStoreNames.contains(e)||c.createObjectStore(e)},o.onsuccess=function(){const a=o.result.transaction(e,"readwrite").objectStore(e).put(s,u);a.onsuccess=function(){n()},a.onerror=function(){console.error("Error saving data to IndexedDB:",a.error),r(a.error)}},o.onerror=function(){console.error("Error opening IndexedDB:",o.error),r(o.error)}}catch(o){console.error("Exception thrown while opening IndexedDB:",o),r(o);return}})},l.deleteFromIndexedDB=async function(i,e,u){return new Promise((s,n)=>{try{const r=indexedDB.open(i,1);r.onupgradeneeded=function(){const o=r.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},r.onsuccess=function(){const t=r.result.transaction(e,"readwrite").objectStore(e).delete(u);t.onsuccess=function(){s()},t.onerror=function(){console.error("Error deleting data from IndexedDB:",t.error),n(t.error)}},r.onerror=function(){console.error("Error opening IndexedDB:",r.error),n(r.error)}}catch(r){console.error("Exception thrown while opening IndexedDB:",r),n(r);return}})},l.keyExistsInIndexedDB=async function(i,e,u){return new Promise((s,n)=>{try{const r=indexedDB.open(i,1);r.onupgradeneeded=function(){const o=r.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},r.onsuccess=function(){const t=r.result.transaction(e,"readonly").objectStore(e).count(u);t.onsuccess=function(){s(t.result>0)},t.onerror=function(){console.error("Error checking key existence in IndexedDB:",t.error),n(t.error)}},r.onerror=function(){console.error("Error opening IndexedDB:",r.error),n(r.error)}}catch(r){console.error("Exception thrown while opening IndexedDB:",r),n(r);return}})},l.getAllKeysFromIndexedDB=async function(i,e){return new Promise((u,s)=>{try{const n=indexedDB.open(i,1);n.onupgradeneeded=function(){const r=n.result;r.objectStoreNames.contains(e)||r.createObjectStore(e)},n.onsuccess=function(){const c=n.result.transaction(e,"readonly").objectStore(e).getAllKeys();c.onsuccess=function(){u(c.result||[])},c.onerror=function(){console.error("Error listing keys from IndexedDB:",c.error),s(c.error)}},n.onerror=function(){console.error("Error opening IndexedDB:",n.error),s(n.error)}}catch(n){console.error("Exception thrown while opening IndexedDB:",n),s(n);return}})},l.getAllFromIndexedDB=async function(i,e){return new Promise((u,s)=>{try{const n=indexedDB.open(i,1);n.onupgradeneeded=function(){const r=n.result;r.objectStoreNames.contains(e)||r.createObjectStore(e)},n.onsuccess=function(){const o=n.result.transaction(e,"readonly"),d=o.objectStore(e),c=d.getAllKeys(),t=d.getAll();o.oncomplete=function(){const a=c.result||[],g=t.result||[];u(a.map((p,B)=>({key:p,value:g[B]})))},o.onerror=function(){console.error("Error reading all data from IndexedDB:",o.error),s(o.error)}},n.onerror=function(){console.error("Error opening IndexedDB:",n.error),s(n.error)}}catch(n){console.error("Exception thrown while opening IndexedDB:",n),s(n);return}})}})(f=x.indexedDb||(x.indexedDb={}))})(gdjs||(gdjs={}));
|
||||
//# sourceMappingURL=indexeddb.js.map
|
||||
Reference in New Issue
Block a user