UNPKG

@nodesecure/js-x-ray

Version:
24 lines 918 B
// Import Internal Dependencies import {} from "../Deobfuscator.js"; import { notNullOrUndefined } from "../utils/index.js"; // CONSTANTS const kJJRegularSymbols = new Set(["$", "_"]); export function verify(identifiers, counters) { if ((counters.VariableDeclarator && counters.VariableDeclarator > 0) || (counters.FunctionDeclaration && counters.FunctionDeclaration > 0)) { return false; } if ((counters.AssignmentExpression ?? 0) > (counters.Property ?? 0)) { return false; } const matchCount = identifiers.filter(({ name }) => { if (!notNullOrUndefined(name)) { return false; } const charsCode = [...new Set([...name])]; return charsCode.every((char) => kJJRegularSymbols.has(char)); }).length; const pourcent = ((matchCount / identifiers.length) * 100); return pourcent > 80; } //# sourceMappingURL=jjencode.js.map