UNPKG

gy-roslib

Version:

gy

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