-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathdev.ts
More file actions
41 lines (38 loc) · 1.25 KB
/
dev.ts
File metadata and controls
41 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
(function () {
const JavaScriptObfuscator: any = require('../../index');
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
var obj = {
foo: 1
}
`,
{
compact: false,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
disableConsoleOutput: false,
identifierNamesGenerator: 'mangled',
log: true,
numbersToExpressions: true,
renameProperties: true,
renamePropertiesMode: 'safe',
simplify: false,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayIndexShift: true,
stringArrayRotate: false,
stringArrayShuffle: false,
stringArrayWrappersCount: 5,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 5,
stringArrayWrappersType: 'function',
stringArrayThreshold: 0,
transformObjectKeys: true,
unicodeEscapeSequence: false,
ignoreImports: false
}
).getObfuscatedCode();
console.log(obfuscatedCode);
console.log(eval(obfuscatedCode));
})();