@nodesecure/js-x-ray
Version:
JavaScript AST XRay analysis
28 lines • 954 B
JavaScript
// 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;
}
for (const char of name) {
if (!kJJRegularSymbols.has(char)) {
return false;
}
}
return true;
}).length;
const pourcent = ((matchCount / identifiers.length) * 100);
return pourcent > 80;
}
//# sourceMappingURL=jjencode.js.map