UNPKG

gy-roslib

Version:

gy

1 lines 1.15 kB
var initWasm=async(_0xee0b68={},_0x346ba9)=>{let _0x387233;if(_0x346ba9['startsWith']('data:')){const _0x458081=_0x346ba9['replace'](/^data:.*?base64,/,'');let _0x3c4393;if(typeof Buffer==='function'&&typeof Buffer['from']==='function')_0x3c4393=Buffer['from'](_0x458081,'base64');else{if(typeof atob==='function'){const _0x339a10=atob(_0x458081);_0x3c4393=new Uint8Array(_0x339a10['length']);for(let _0x4c2309=0x0;_0x4c2309<_0x339a10['length'];_0x4c2309++){_0x3c4393[_0x4c2309]=_0x339a10['charCodeAt'](_0x4c2309);}}else throw new Error('Failed\x20to\x20decode\x20base64-encoded\x20data\x20URL,\x20Buffer\x20and\x20atob\x20are\x20not\x20supported');}_0x387233=await WebAssembly['instantiate'](_0x3c4393,_0xee0b68);}else{const _0x153cf1=await fetch(_0x346ba9),_0x513f1d=_0x153cf1['headers']['get']('Content-Type')||'';if('instantiateStreaming'in WebAssembly&&_0x513f1d['startsWith']('application/wasm'))_0x387233=await WebAssembly['instantiateStreaming'](_0x153cf1,_0xee0b68);else{const _0x4bd60e=await _0x153cf1['arrayBuffer']();_0x387233=await WebAssembly['instantiate'](_0x4bd60e,_0xee0b68);}}return _0x387233['instance'];};export{initWasm as i};