Files
javascript-obfuscator-javas…/test/dev/dev.ts
T
2025-12-04 00:09:10 +04:00

42 lines
1.3 KiB
TypeScript

'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));
})();