mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Added renamePropertiesAutoExclude option
This commit is contained in:
+12
-10
@@ -7,20 +7,22 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
|
||||
|
||||
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
||||
`
|
||||
function foo () {
|
||||
if (bar) {
|
||||
if (baz) {
|
||||
const a = aa()
|
||||
}
|
||||
} else {
|
||||
bb()
|
||||
}
|
||||
}
|
||||
const object = {
|
||||
foo: 1,
|
||||
bar: 2,
|
||||
baz: 3
|
||||
};
|
||||
|
||||
var excluded1 = 'bar';
|
||||
var excluded2 = 'baz';
|
||||
|
||||
console.log(object.foo, object['bar'], object.baz);
|
||||
`,
|
||||
{
|
||||
...NO_ADDITIONAL_NODES_PRESET,
|
||||
compact: false,
|
||||
simplify: true
|
||||
renameProperties: true,
|
||||
renamePropertiesAutoExclude: true
|
||||
}
|
||||
).getObfuscatedCode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user