UNPKG

humanifyjs

Version:

> Deobfuscate Javascript code using LLMs ("AI")

12 lines (11 loc) 591 B
import { showPercentage } from "../../progress.js"; import { defineFilename } from "./define-filename.js"; import { unminifyVariableName } from "./unminify-variable-name.js"; import { visitAllIdentifiers } from "./visit-all-identifiers.js"; const PADDING_CHARS = 200; export const localReanme = (prompt) => { return async (code) => { const filename = await defineFilename(prompt, code.slice(0, PADDING_CHARS * 2)); return await visitAllIdentifiers(code, (name, surroundingCode) => unminifyVariableName(prompt, name, filename, surroundingCode), showPercentage); }; };