scandit-web-datacapture-core
Version:
Scandit Data Capture SDK for the Web
6 lines (3 loc) • 731 B
JavaScript
import { a as a$1 } from './chunk-QCZSSQAQ.js';
var i=Promise.resolve(),c=!1,a=!1,n,l={writableDataPath:""};async function f(e){if(n==null)return;c=!0;let t=new Promise((s,o)=>{setTimeout(()=>{o(new a$1({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}));},1500);});try{await Promise.race([new Promise((s,o)=>{n==null||n(e,r=>{if(r!=null){o(r);return}s();});}),t]);}finally{c=!1;}}async function u(e){return a||(c?(a=!0,i=i.then(async()=>(a=!1,f(e)))):i=f(e)),i}async function y(e){l=e,n=FS.syncfs,FS.syncfs=(t,s)=>{let o=s,r=S=>{o(S);};u(t).then(r).catch(r);};try{FS.mkdir(l.writableDataPath);}catch(t){if(t.code!=="EEXIST")throw n=void 0,t}return FS.mount(IDBFS,{},l.writableDataPath),u(!0)}
export { y as a };