mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Improved mangled identifier names generator. Improved variable preserving.
This commit is contained in:
+10
-8
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user