UNPKG

gy-roslib

Version:

gy

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