mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
This commit is contained in:
+8
-38
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user