sanex3339
2020-01-03 14:34:15 +03:00
parent 79be099fb4
commit 114b053bd9
20 changed files with 85 additions and 91 deletions
+8 -38
View File
@@ -1,51 +1,21 @@
'use strict';
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
(function () {
const JavaScriptObfuscator: any = require('../../index');
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
// Paste your JavaScript code here
function hi() {
console.log("Hello World!");
async function testFunc(params) {
for await (let param of params) {
}
}
hi();
testFunc(['foo']);
`,
{
compact: false,
selfDefending: false,
disableConsoleOutput: false,
debugProtection: false,
debugProtectionInterval: false,
splitStrings: true,
splitStringsChunkLength: 5,
splitStringsChunkLengthEnabled: true,
stringArray: true,
rotateStringArray: false,
rotateStringArrayEnabled: true,
stringArrayThreshold: 1,
stringArrayThresholdEnabled: true,
stringArrayEncoding: false,
stringArrayEncodingEnabled: true,
sourceMap: false,
sourceMapBaseUrl: "",
sourceMapFileName: "",
sourceMapSeparate: false,
domainLock: [],
reservedNames: [],
reservedStrings: [],
seed: 0,
controlFlowFlatteningThreshold: 1,
controlFlowFlattening: true,
deadCodeInjectionThreshold: 1,
deadCodeInjection: true,
unicodeEscapeSequence: false,
renameGlobals: true,
identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
identifiersDictionary: ["foo", "bar", "baz", "bark", "hawk", "fooz", "moscow", "chikago"],
identifiersPrefix: "",
transformObjectKeys: true
...NO_ADDITIONAL_NODES_PRESET
}
).getObfuscatedCode();