Improved mangled identifier names generator. Improved variable preserving.

This commit is contained in:
sanex3339
2020-02-11 23:03:02 +03:00
parent 029d5953c2
commit 002697caf5
27 changed files with 255 additions and 164 deletions
+10 -8
View File
@@ -7,21 +7,23 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
function foo () {
const testA = 'abc';
const testB = 'abc';
const testC = 'abc';
const testD = 'abc';
function a (a, b) {
}
function b (b, c) {
}
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
identifierNamesGenerator: 'dictionary',
identifiersDictionary: ['a', 'b', 'aa'],
identifierNamesGenerator: 'mangled',
identifiersPrefix: 'a',
transformObjectKeys: true,
stringArray: true,
stringArrayThreshold: 1
stringArrayThreshold: 1,
log: true
}
).getObfuscatedCode();