UNPKG

gy-roslib

Version:

gy

1 lines 1.14 kB
'use strict';exports['initWasm']=async(_0x11686f={},_0x4d471d)=>{let _0x53179d;if(_0x4d471d['startsWith']('data:')){const _0x3319ad=_0x4d471d['replace'](/^data:.*?base64,/,'');let _0x3e671d;if('function'==typeof Buffer&&'function'==typeof Buffer['from'])_0x3e671d=Buffer['from'](_0x3319ad,'base64');else{if('function'!=typeof atob)throw new Error('Failed\x20to\x20decode\x20base64-encoded\x20data\x20URL,\x20Buffer\x20and\x20atob\x20are\x20not\x20supported');{const _0x348840=atob(_0x3319ad);_0x3e671d=new Uint8Array(_0x348840['length']);for(let _0x445ea9=0x0;_0x445ea9<_0x348840['length'];_0x445ea9++)_0x3e671d[_0x445ea9]=_0x348840['charCodeAt'](_0x445ea9);}}_0x53179d=await WebAssembly['instantiate'](_0x3e671d,_0x11686f);}else{const _0x264602=await fetch(_0x4d471d),_0x172a38=_0x264602['headers']['get']('Content-Type')||'';if('instantiateStreaming'in WebAssembly&&_0x172a38['startsWith']('application/wasm'))_0x53179d=await WebAssembly['instantiateStreaming'](_0x264602,_0x11686f);else{const _0x115e8f=await _0x264602['arrayBuffer']();_0x53179d=await WebAssembly['instantiate'](_0x115e8f,_0x11686f);}}return _0x53179d['instance'];};