Added mangled-shuffled identifier names generator

This commit is contained in:
sanex3339
2020-07-09 11:10:31 +03:00
parent cd20be4036
commit 27be5b2cd5
14 changed files with 110 additions and 55 deletions
+4 -10
View File
@@ -1,5 +1,6 @@
'use strict';
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
(function () {
@@ -7,20 +8,13 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
function foo() {
if (true) {
if (false) {
var bar = baz();
}
} else {
var bark = hawk();
}
function foo (arg1, arg2, arg3) {
console.log(arg1, arg2, arg3);
}
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
simplify: true
identifierNamesGenerator: IdentifierNamesGenerator.MangledShuffledIdentifierNamesGenerator
}
).getObfuscatedCode();