dev.ts 656 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. if (!(<any>global)._babelPolyfill) {
  3. require('babel-polyfill');
  4. }
  5. (function () {
  6. const JavaScriptObfuscator: any = require("../../index");
  7. let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
  8. `
  9. (function () {
  10. var variable1 = 1 + 2;
  11. var variable2 = 2 + 3;
  12. })();
  13. `,
  14. {
  15. compact: false,
  16. controlFlowFlattening: true,
  17. controlFlowFlatteningThreshold: 1,
  18. disableConsoleOutput: false
  19. }
  20. ).getObfuscatedCode();
  21. console.log(obfuscatedCode);
  22. console.log(eval(obfuscatedCode));
  23. })();