mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-26 00:41:52 +08:00
style: lint and fmt code
This commit is contained in:
Vendored
+9
-11
@@ -1,19 +1,17 @@
|
||||
const isNode =
|
||||
typeof process !== "undefined" &&
|
||||
process?.versions?.node != null;
|
||||
const isNode = typeof process !== "undefined" && process?.versions?.node != null;
|
||||
const wasmPath = async () => {
|
||||
const url = new URL("./cfr.wasm", import.meta.url).href;
|
||||
return isNode ? await import("node:url").then((mod) => mod.fileURLToPath(url)) : url;
|
||||
const url = new URL("./cfr.wasm", import.meta.url).href;
|
||||
return isNode ? await import("node:url").then((mod) => mod.fileURLToPath(url)) : url;
|
||||
};
|
||||
|
||||
let decompileFunc = null;
|
||||
export const decompile = async (name, options) => {
|
||||
if (!decompileFunc) {
|
||||
const { load } = await import("./cfr.wasm-runtime.js");
|
||||
const { exports } = await load(await wasmPath(), { noAutoImports: true });
|
||||
if (!decompileFunc) {
|
||||
const { load } = await import("./cfr.wasm-runtime.js");
|
||||
const { exports } = await load(await wasmPath(), { noAutoImports: true });
|
||||
|
||||
decompileFunc = exports.decompile;
|
||||
}
|
||||
decompileFunc = exports.decompile;
|
||||
}
|
||||
|
||||
return decompileFunc(name, options);
|
||||
return decompileFunc(name, options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user