Default.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { TInputOptions } from '../../types/options/TInputOptions';
  2. import { IdentifierNamesGenerator } from '../../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
  3. import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
  4. import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
  5. import { RenamePropertiesMode } from '../../enums/node-transformers/rename-properties-transformers/RenamePropertiesMode';
  6. import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
  7. import { StringArrayIndexesType } from '../../enums/node-transformers/string-array-transformers/StringArrayIndexesType';
  8. import { StringArrayEncoding } from '../../enums/node-transformers/string-array-transformers/StringArrayEncoding';
  9. import { StringArrayWrappersType } from '../../enums/node-transformers/string-array-transformers/StringArrayWrappersType';
  10. export const DEFAULT_PRESET: TInputOptions = Object.freeze({
  11. compact: true,
  12. config: '',
  13. controlFlowFlattening: false,
  14. controlFlowFlatteningThreshold: 0.75,
  15. deadCodeInjection: false,
  16. deadCodeInjectionThreshold: 0.4,
  17. debugProtection: false,
  18. debugProtectionInterval: false,
  19. disableConsoleOutput: false,
  20. domainLock: [],
  21. domainDest: 'about:blank',
  22. exclude: [],
  23. forceTransformStrings: [],
  24. identifierNamesCache: null,
  25. identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
  26. identifiersPrefix: '',
  27. identifiersDictionary: [],
  28. ignoreRequireImports: false,
  29. inputFileName: '',
  30. log: false,
  31. numbersToExpressions: false,
  32. optionsPreset: OptionsPreset.Default,
  33. renameGlobals: false,
  34. renameProperties: false,
  35. renamePropertiesMode: RenamePropertiesMode.Safe,
  36. reservedNames: [],
  37. reservedStrings: [],
  38. rotateStringArray: true,
  39. seed: 0,
  40. selfDefending: false,
  41. shuffleStringArray: true,
  42. simplify: true,
  43. sourceMap: false,
  44. sourceMapBaseUrl: '',
  45. sourceMapFileName: '',
  46. sourceMapMode: SourceMapMode.Separate,
  47. splitStrings: false,
  48. splitStringsChunkLength: 10,
  49. stringArray: true,
  50. stringArrayEncoding: [
  51. StringArrayEncoding.None
  52. ],
  53. stringArrayIndexesType: [
  54. StringArrayIndexesType.HexadecimalNumber
  55. ],
  56. stringArrayIndexShift: true,
  57. stringArrayWrappersChainedCalls: true,
  58. stringArrayWrappersCount: 1,
  59. stringArrayWrappersParametersMaxCount: 2,
  60. stringArrayWrappersType: StringArrayWrappersType.Variable,
  61. stringArrayThreshold: 0.75,
  62. target: ObfuscationTarget.Browser,
  63. transformObjectKeys: false,
  64. unicodeEscapeSequence: false
  65. });