Ignore object expressions as body of arrow function expression when transformObjectKeys option is enabled

This commit is contained in:
sanex
2020-11-19 07:45:41 +03:00
parent c7cc68bedb
commit b2aee6cb6c
11 changed files with 137 additions and 121 deletions
+4 -30
View File
@@ -1,46 +1,20 @@
'use strict';
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
import { StringArrayIndexesType } from '../../src/enums/node-transformers/string-array-transformers/StringArrayIndexesType';
(function () {
const JavaScriptObfuscator: any = require('../../index');
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
// Paste your JavaScript code here
function hi() {
function inner () {
console.log('inner');
console.log('inner1');
}
console.log("Hello World!");
inner();
}
hi();
const test = () => ({
foo: 'bar'
});
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
rotateStringArray: true,
shuffleStringArray: true,
stringArray: true,
/*stringArrayEncoding: [
StringArrayEncoding.None,
StringArrayEncoding.Rc4
],*/
stringArrayIndexesType: [
StringArrayIndexesType.HexadecimalNumericString,
StringArrayIndexesType.HexadecimalNumber
],
stringArrayIndexShift: true,
stringArrayThreshold: 1,
stringArrayWrappersCount: 1,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 2,
stringArrayWrappersType: 'function'
transformObjectKeys: true
}
).getObfuscatedCode();