forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.ts
More file actions
30 lines (25 loc) · 782 Bytes
/
dev.ts
File metadata and controls
30 lines (25 loc) · 782 Bytes
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
'use strict';
import { NO_CUSTOM_NODES_PRESET } from '../../src/preset-options/NoCustomNodesPreset';
if (!(<any>global)._babelPolyfill) {
require('babel-polyfill');
}
(function () {
const JavaScriptObfuscator: any = require("../../index");
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(`
(function(){
function t () {
return function () {
var t = 1 * 2;
}
}
var s = 1 - 3;
})();
`,
Object.assign({}, NO_CUSTOM_NODES_PRESET, {
controlFlowFlattening: true,
disableConsoleOutput: false
})
).getObfuscatedCode();
console.log(obfuscatedCode);
console.log(eval(obfuscatedCode));
})();