mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 16:01:52 +08:00
style: lint and fmt code
This commit is contained in:
Vendored
+6
-6
@@ -1,10 +1,10 @@
|
||||
declare module "@run-slicer/cfr" {
|
||||
export type Options = Record<string, string>;
|
||||
export type Options = Record<string, string>;
|
||||
|
||||
export interface Config {
|
||||
source?: (name: string) => Uint8Array | null;
|
||||
options?: Options;
|
||||
}
|
||||
export interface Config {
|
||||
source?: (name: string) => Uint8Array | null;
|
||||
options?: Options;
|
||||
}
|
||||
|
||||
export function decompile(name: string, config?: Config): Promise<string>;
|
||||
export function decompile(name: string, config?: Config): Promise<string>;
|
||||
}
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
Vendored
+1018
-8
File diff suppressed because one or more lines are too long
Vendored
+11
-11
@@ -2,23 +2,23 @@
|
||||
"name": "@run-slicer/cfr",
|
||||
"version": "0.1.6-0.152",
|
||||
"description": "A JavaScript port of the CFR decompiler (https://github.com/leibnitz27/cfr).",
|
||||
"keywords": [
|
||||
"cfr",
|
||||
"decompilation",
|
||||
"decompiler",
|
||||
"java"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "run-slicer",
|
||||
"type": "module",
|
||||
"main": "cfr.js",
|
||||
"module": "cfr.js",
|
||||
"types": "cfr.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./cfr.d.ts",
|
||||
"import": "./cfr.js",
|
||||
"default": "./cfr.js"
|
||||
}
|
||||
},
|
||||
"types": "cfr.d.ts",
|
||||
"keywords": [
|
||||
"decompiler",
|
||||
"java",
|
||||
"decompilation",
|
||||
"cfr"
|
||||
],
|
||||
"author": "run-slicer",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user