Added numbersToExpressions option and NumberToNumericalExpressionTransformer

This commit is contained in:
sanex3339
2020-07-12 18:24:57 +03:00
parent f07452e139
commit dd8dcac223
23 changed files with 1048 additions and 31777 deletions
+3 -12
View File
@@ -1,6 +1,5 @@
'use strict';
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
(function () {
@@ -8,21 +7,13 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
const example1 = 0;
const example2 = 1;
const example3 = 100;
const example4 = 125793;
const example5 = -15232103;
const foo = 100;
console.log(example1);
console.log(example2);
console.log(example3);
console.log(example4);
console.log(example5);
console.log(foo);
`,
{
...NO_ADDITIONAL_NODES_PRESET,
identifierNamesGenerator: IdentifierNamesGenerator.MangledShuffledIdentifierNamesGenerator
numbersToExpressions: true
}
).getObfuscatedCode();