dev.ts 814 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
  3. (function () {
  4. const JavaScriptObfuscator: any = require('../../index');
  5. let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
  6. `
  7. function a (a, b) {
  8. }
  9. function b (b, c) {
  10. }
  11. `,
  12. {
  13. ...NO_ADDITIONAL_NODES_PRESET,
  14. compact: false,
  15. identifierNamesGenerator: 'mangled',
  16. identifiersPrefix: 'a',
  17. transformObjectKeys: true,
  18. stringArray: true,
  19. stringArrayThreshold: 1,
  20. log: true
  21. }
  22. ).getObfuscatedCode();
  23. console.log(obfuscatedCode);
  24. console.log(eval(obfuscatedCode));
  25. })();