Fixed wrong names generation for the custom nodes

This commit is contained in:
sanex3339
2020-02-15 14:14:59 +03:00
parent daba144e76
commit dd7c1df9f9
17 changed files with 188 additions and 119 deletions
+7 -4
View File
@@ -7,16 +7,19 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
function foo () {
const a = '123';
const b = '234';
const c = '345';
}
console.log(a, b, c);
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
identifierNamesGenerator: 'mangled',
renameGlobals: true,
reservedNames: ['a'],
selfDefending: true,
stringArray: true,
stringArrayThreshold: 1,
log: true
}
).getObfuscatedCode();