unicodeEscapeSequence logic moved to the EscapeSequenceTransformer

This commit is contained in:
sanex
2020-09-24 11:01:23 +03:00
parent 675feebbbb
commit 4c1bae0527
47 changed files with 402 additions and 273 deletions
+3 -7
View File
@@ -2,14 +2,13 @@
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
import { StringArrayWrappersType } from '../../src/enums/node-transformers/string-array-transformers/StringArrayWrappersType';
(function () {
const JavaScriptObfuscator: any = require('../../index');
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
const foo = 'foo';
const foo = 'foo test';
function test () {
const bar = 'bar';
@@ -18,13 +17,10 @@ import { StringArrayWrappersType } from '../../src/enums/node-transformers/strin
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
forceTransformedStrings: ['foo'],
identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator,
stringArray: true,
stringArrayThreshold: 0,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersCount: 1,
stringArrayWrappersType: StringArrayWrappersType.Function
stringArrayThreshold: 1,
unicodeEscapeSequence: false
}
).getObfuscatedCode();