Преглед изворни кода

Merge pull request #540 from javascript-obfuscator/eslint-migration

Eslint migration
Timofey Kachalov пре 5 година
родитељ
комит
f450b63eb8
100 измењених фајлова са 525 додато и 221 уклоњено
  1. 2 0
      .eslintignore
  2. 297 0
      .eslintrc.js
  3. 0 0
      dist/index.browser.js
  4. 0 0
      dist/index.cli.js
  5. 0 0
      dist/index.js
  6. 19 14
      package.json
  7. 1 1
      scripts/build
  8. 3 0
      scripts/eslint
  9. 1 1
      scripts/travis
  10. 0 3
      scripts/tslint
  11. 4 6
      src/ASTParserFacade.ts
  12. 1 1
      src/JavaScriptObfuscator.ts
  13. 1 1
      src/JavaScriptObfuscatorFacade.ts
  14. 1 1
      src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts
  15. 1 1
      src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts
  16. 2 2
      src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts
  17. 1 1
      src/analyzers/scope-analyzer/ScopeAnalyzer.ts
  18. 1 1
      src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts
  19. 4 4
      src/cli/JavaScriptObfuscatorCLI.ts
  20. 2 2
      src/cli/sanitizers/ArraySanitizer.ts
  21. 1 1
      src/cli/utils/SourceCodeReader.ts
  22. 8 8
      src/container/InversifyContainerFacade.ts
  23. 1 1
      src/container/modules/custom-nodes/CustomNodesModule.ts
  24. 1 1
      src/container/modules/generators/GeneratorsModule.ts
  25. 1 1
      src/container/modules/node-transformers/PreparingTransformersModule.ts
  26. 1 1
      src/container/modules/storages/StoragesModule.ts
  27. 10 10
      src/custom-nodes/AbstractCustomNode.ts
  28. 19 19
      src/custom-nodes/AbstractCustomNodeGroup.ts
  29. 1 1
      src/custom-nodes/CustomNodeFormatter.ts
  30. 1 1
      src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts
  31. 1 1
      src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts
  32. 1 1
      src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts
  33. 1 1
      src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts
  34. 1 1
      src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts
  35. 1 1
      src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts
  36. 1 1
      src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts
  37. 2 2
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts
  38. 1 1
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts
  39. 1 1
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts
  40. 1 1
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts
  41. 1 1
      src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts
  42. 1 1
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts
  43. 1 1
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts
  44. 1 1
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts
  45. 1 1
      src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts
  46. 2 2
      src/custom-nodes/domain-lock-nodes/DomainLockNode.ts
  47. 1 1
      src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts
  48. 1 1
      src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts
  49. 1 1
      src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts
  50. 1 1
      src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts
  51. 1 1
      src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts
  52. 1 1
      src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts
  53. 1 1
      src/custom-nodes/string-array-nodes/StringArrayNode.ts
  54. 1 1
      src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts
  55. 1 1
      src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts
  56. 1 1
      src/declarations/ESTree.d.ts
  57. 1 1
      src/declarations/escodegen.d.ts
  58. 1 2
      src/declarations/eslint-scope.d.ts
  59. 4 6
      src/decorators/Initializable.ts
  60. 13 13
      src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts
  61. 1 1
      src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts
  62. 1 1
      src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts
  63. 1 1
      src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts
  64. 0 1
      src/interfaces/utils/ICryptUtils.ts
  65. 2 2
      src/logger/Logger.ts
  66. 1 1
      src/node-transformers/AbstractNodeTransformer.ts
  67. 3 3
      src/node-transformers/TransformersRunner.ts
  68. 2 2
      src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts
  69. 2 2
      src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts
  70. 9 9
      src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts
  71. 1 1
      src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts
  72. 2 2
      src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts
  73. 2 2
      src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts
  74. 1 1
      src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts
  75. 2 2
      src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts
  76. 2 2
      src/node-transformers/converting-transformers/MemberExpressionTransformer.ts
  77. 2 2
      src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts
  78. 2 2
      src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts
  79. 2 2
      src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts
  80. 3 3
      src/node-transformers/converting-transformers/SplitStringTransformer.ts
  81. 4 4
      src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts
  82. 4 4
      src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts
  83. 10 4
      src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts
  84. 2 2
      src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts
  85. 3 3
      src/node-transformers/obfuscating-transformers/LiteralTransformer.ts
  86. 2 2
      src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts
  87. 1 1
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts
  88. 1 1
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts
  89. 1 1
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts
  90. 1 1
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts
  91. 1 1
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts
  92. 4 4
      src/node-transformers/preparing-transformers/CommentsTransformer.ts
  93. 3 3
      src/node-transformers/preparing-transformers/CustomNodesTransformer.ts
  94. 4 4
      src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts
  95. 2 2
      src/node-transformers/preparing-transformers/MetadataTransformer.ts
  96. 2 2
      src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts
  97. 2 2
      src/node-transformers/preparing-transformers/ParentificationTransformer.ts
  98. 3 3
      src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts
  99. 1 1
      src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts
  100. 1 1
      src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts

+ 2 - 0
.eslintignore

@@ -0,0 +1,2 @@
+/test
+/webpack

+ 297 - 0
.eslintrc.js

@@ -0,0 +1,297 @@
+module.exports = {
+    "env": {
+        "browser": true,
+        "es6": true,
+        "node": true
+    },
+    "parser": "@typescript-eslint/parser",
+    "parserOptions": {
+        "project": "src/tsconfig.node.json",
+        "sourceType": "module"
+    },
+    "plugins": [
+        "@typescript-eslint",
+        "import",
+        "jsdoc",
+        "prefer-arrow",
+        "unicorn"
+    ],
+    "rules": {
+        "@typescript-eslint/adjacent-overload-signatures": "error",
+        "@typescript-eslint/array-type": [
+            "error",
+            {
+                "default": "array"
+            }
+        ],
+        "@typescript-eslint/await-thenable": "error",
+        "@typescript-eslint/ban-ts-comment": "error",
+        "@typescript-eslint/ban-types": "error",
+        "@typescript-eslint/brace-style": [
+            "error",
+            "1tbs",
+            {
+                "allowSingleLine": true
+            }
+        ],
+        "@typescript-eslint/camelcase": "off",
+        "@typescript-eslint/class-name-casing": "error",
+        "@typescript-eslint/comma-spacing": "error",
+        "@typescript-eslint/consistent-type-assertions": [
+            "error",
+            {
+                "assertionStyle": "angle-bracket"
+            }
+        ],
+        "@typescript-eslint/consistent-type-definitions": "error",
+        "@typescript-eslint/default-param-last": "error",
+        "@typescript-eslint/explicit-function-return-type": "error",
+        "@typescript-eslint/explicit-member-accessibility": [
+            "error",
+            {
+                "accessibility": "explicit"
+            }
+        ],
+        "@typescript-eslint/explicit-module-boundary-types": "error",
+        "@typescript-eslint/func-call-spacing": "error",
+        "@typescript-eslint/indent": [
+            "off",
+            4
+        ],
+        "@typescript-eslint/interface-name-prefix": [
+            "error",
+            "always"
+        ],
+        "@typescript-eslint/member-delimiter-style": [
+            "error",
+            {
+                "multiline": {
+                    "delimiter": "semi",
+                    "requireLast": true
+                },
+                "singleline": {
+                    "delimiter": "semi",
+                    "requireLast": false
+                }
+            }
+        ],
+        "@typescript-eslint/member-ordering": "error",
+        "@typescript-eslint/no-empty-function": "off",
+        "@typescript-eslint/no-empty-interface": "error",
+        "@typescript-eslint/no-explicit-any": "off",
+        "@typescript-eslint/no-extra-parens": "off",
+        "@typescript-eslint/no-floating-promises": "error",
+        "@typescript-eslint/no-for-in-array": "error",
+        "@typescript-eslint/no-inferrable-types": "off",
+        "@typescript-eslint/no-magic-numbers": "off",
+        "@typescript-eslint/no-misused-new": "error",
+        "@typescript-eslint/no-namespace": "error",
+        "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
+        "@typescript-eslint/no-non-null-assertion": "error",
+        "@typescript-eslint/no-param-reassign": "off",
+        "@typescript-eslint/no-parameter-properties": "error",
+        "@typescript-eslint/no-require-imports": "off",
+        "@typescript-eslint/no-this-alias": "error",
+        "@typescript-eslint/no-unnecessary-qualifier": "error",
+        "@typescript-eslint/no-unnecessary-type-arguments": "error",
+        "@typescript-eslint/no-unnecessary-type-assertion": "error",
+        "@typescript-eslint/no-unused-expressions": "error",
+        "@typescript-eslint/no-use-before-define": "off",
+        "@typescript-eslint/no-var-requires": "error",
+        "@typescript-eslint/prefer-for-of": "error",
+        "@typescript-eslint/prefer-function-type": "error",
+        "@typescript-eslint/prefer-namespace-keyword": "error",
+        "@typescript-eslint/prefer-nullish-coalescing": "error",
+        "@typescript-eslint/prefer-optional-chain": "error",
+        "@typescript-eslint/prefer-readonly": "error",
+        "@typescript-eslint/promise-function-async": "error",
+        "@typescript-eslint/quotes": [
+            "error",
+            "single"
+        ],
+        "@typescript-eslint/require-array-sort-compare": "error",
+        "@typescript-eslint/restrict-plus-operands": "error",
+        "@typescript-eslint/semi": [
+            "error",
+            "always"
+        ],
+        "@typescript-eslint/space-before-function-paren": "error",
+        "@typescript-eslint/strict-boolean-expressions": "off",
+        "@typescript-eslint/triple-slash-reference": "error",
+        "@typescript-eslint/type-annotation-spacing": "error",
+        "@typescript-eslint/typedef": "error",
+        "@typescript-eslint/unified-signatures": "error",
+        "arrow-body-style": "off",
+        "arrow-parens": [
+            "off",
+            "as-needed"
+        ],
+        "brace-style": "off",
+        "capitalized-comments": "off",
+        "comma-dangle": "off",
+        "comma-spacing": "off",
+        "complexity": [
+            "error",
+            {
+                "max": 10
+            }
+        ],
+        "constructor-super": "error",
+        "curly": "error",
+        "default-case": "off",
+        "dot-notation": "error",
+        "eol-last": "error",
+        "eqeqeq": [
+            "error",
+            "smart"
+        ],
+        "func-call-spacing": "off",
+        "guard-for-in": "error",
+        "id-blacklist": "off",
+        "id-match": "off",
+        "import/no-default-export": "error",
+        "import/no-deprecated": "error",
+        "import/no-extraneous-dependencies": "error",
+        "import/no-internal-modules": "error",
+        "import/no-unassigned-import": "off",
+        "import/order": "off",
+        "indent": "off",
+        "jsdoc/no-types": "off",
+        "linebreak-style": "error",
+        "max-classes-per-file": [
+            "error",
+            1
+        ],
+        "max-len": "off",
+        "max-lines": [
+            "error",
+            500
+        ],
+        "new-parens": "error",
+        "newline-per-chained-call": "off",
+        "no-bitwise": "off",
+        "no-caller": "error",
+        "no-cond-assign": "error",
+        "no-console": [
+            "error",
+            {
+                "allow": [
+                    "log",
+                    "warn",
+                    "dir",
+                    "timeLog",
+                    "assert",
+                    "clear",
+                    "count",
+                    "countReset",
+                    "group",
+                    "groupEnd",
+                    "table",
+                    "dirxml",
+                    "error",
+                    "groupCollapsed",
+                    "Console",
+                    "profile",
+                    "profileEnd",
+                    "timeStamp",
+                    "context"
+                ]
+            }
+        ],
+        "no-constant-condition": "error",
+        "no-control-regex": "off",
+        "no-debugger": "error",
+        "no-duplicate-case": "error",
+        "no-duplicate-imports": "error",
+        "no-empty": "off",
+        "no-eval": "off",
+        "no-extra-bind": "error",
+        "no-extra-parens": "off",
+        "no-extra-semi": "error",
+        "no-fallthrough": "error",
+        "no-invalid-regexp": "error",
+        "no-invalid-this": "off",
+        "no-irregular-whitespace": "error",
+        "no-magic-numbers": "off",
+        "no-multi-str": "error",
+        "no-multiple-empty-lines": "error",
+        "no-new-wrappers": "error",
+        "no-null/no-null": "off",
+        "no-octal": "error",
+        "no-octal-escape": "error",
+        "no-redeclare": "error",
+        "no-regex-spaces": "error",
+        "no-restricted-syntax": [
+            "error",
+            "ForInStatement"
+        ],
+        "no-return-await": "error",
+        "no-sequences": "error",
+        "no-shadow": [
+            "error",
+            {
+                "hoist": "all"
+            }
+        ],
+        "no-sparse-arrays": "error",
+        "no-template-curly-in-string": "error",
+        "no-throw-literal": "error",
+        "no-trailing-spaces": [
+            "error",
+            {
+                "skipBlankLines": true
+            }
+        ],
+        "no-undef-init": "error",
+        "no-underscore-dangle": "off",
+        "no-unsafe-finally": "error",
+        "no-unused-expressions": "off",
+        "no-unused-labels": "error",
+        "no-var": "error",
+        "no-void": "error",
+        "object-shorthand": "off",
+        "one-var": [
+            "error",
+            "never"
+        ],
+        "padding-line-between-statements": [
+            "error",
+            {
+                "blankLine": "always",
+                "prev": "*",
+                "next": "return"
+            }
+        ],
+        "prefer-arrow/prefer-arrow-functions": "off",
+        "prefer-const": "error",
+        "prefer-object-spread": "error",
+        "prefer-template": "error",
+        "quote-props": [
+            "error",
+            "as-needed"
+        ],
+        "quotes": "off",
+        "radix": "error",
+        "space-before-function-paren": "off",
+        "spaced-comment": "error",
+        "space-in-parens": [
+            "error",
+            "never"
+        ],
+        "unicorn/catch-error-name": [
+            "error",
+            {
+                "name": "error"
+            }
+        ],
+        "unicorn/no-array-instanceof": "error",
+        "unicorn/no-nested-ternary": "error",
+        "unicorn/no-unreadable-array-destructuring": "error",
+        "unicorn/prefer-includes": "error",
+        "unicorn/prefer-starts-ends-with": "error",
+        "unicorn/prefer-trim-start-end": "error",
+        "use-isnan": "error",
+        "valid-typeof": "error",
+        "yoda": "error"
+    }
+};

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/index.browser.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/index.cli.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/index.js


+ 19 - 14
package.json

@@ -34,11 +34,10 @@
     "estraverse": "4.3.0",
     "estraverse": "4.3.0",
     "eventemitter3": "4.0.0",
     "eventemitter3": "4.0.0",
     "fast-deep-equal": "3.1.1",
     "fast-deep-equal": "3.1.1",
-    "fork-ts-checker-webpack-plugin": "3.1.1",
     "inversify": "5.0.1",
     "inversify": "5.0.1",
     "js-string-escape": "1.0.1",
     "js-string-escape": "1.0.1",
     "md5": "2.2.1",
     "md5": "2.2.1",
-    "mkdirp": "0.5.1",
+    "mkdirp": "1.0.3",
     "multimatch": "4.0.0",
     "multimatch": "4.0.0",
     "reflect-metadata": "0.1.13",
     "reflect-metadata": "0.1.13",
     "source-map-support": "0.5.16",
     "source-map-support": "0.5.16",
@@ -46,7 +45,7 @@
     "tslib": "1.10.0"
     "tslib": "1.10.0"
   },
   },
   "devDependencies": {
   "devDependencies": {
-    "@types/chai": "4.2.7",
+    "@types/chai": "4.2.8",
     "@types/chance": "1.0.8",
     "@types/chance": "1.0.8",
     "@types/escodegen": "0.0.6",
     "@types/escodegen": "0.0.6",
     "@types/eslint-scope": "3.7.0",
     "@types/eslint-scope": "3.7.0",
@@ -54,28 +53,34 @@
     "@types/estree": "0.0.42",
     "@types/estree": "0.0.42",
     "@types/md5": "2.1.33",
     "@types/md5": "2.1.33",
     "@types/mkdirp": "0.5.2",
     "@types/mkdirp": "0.5.2",
-    "@types/mocha": "5.2.7",
+    "@types/mocha": "7.0.1",
     "@types/multimatch": "4.0.0",
     "@types/multimatch": "4.0.0",
     "@types/node": "12.12.14",
     "@types/node": "12.12.14",
     "@types/rimraf": "2.0.3",
     "@types/rimraf": "2.0.3",
     "@types/sinon": "7.5.1",
     "@types/sinon": "7.5.1",
     "@types/string-template": "1.0.2",
     "@types/string-template": "1.0.2",
-    "@types/webpack-env": "1.15.0",
+    "@types/webpack-env": "1.15.1",
+    "@typescript-eslint/eslint-plugin": "2.18.0",
+    "@typescript-eslint/parser": "2.18.0",
     "chai": "4.2.0",
     "chai": "4.2.0",
     "coveralls": "3.0.9",
     "coveralls": "3.0.9",
-    "mocha": "7.0.0",
+    "eslint": "6.8.0",
+    "eslint-plugin-import": "2.20.0",
+    "eslint-plugin-jsdoc": "21.0.0",
+    "eslint-plugin-no-null": "1.0.2",
+    "eslint-plugin-prefer-arrow": "1.1.7",
+    "eslint-plugin-unicorn": "15.0.1",
+    "fork-ts-checker-notifier-webpack-plugin": "2.0.0",
+    "fork-ts-checker-webpack-plugin": "4.0.3",
+    "mocha": "7.0.1",
     "nyc": "15.0.0",
     "nyc": "15.0.0",
     "pjson": "1.0.9",
     "pjson": "1.0.9",
     "pre-commit": "1.2.2",
     "pre-commit": "1.2.2",
-    "rimraf": "3.0.0",
-    "sinon": "8.0.4",
-    "threads": "1.0.0",
+    "rimraf": "3.0.1",
+    "sinon": "8.1.1",
+    "threads": "1.0.2",
     "ts-loader": "6.2.1",
     "ts-loader": "6.2.1",
     "ts-node": "6.1.0",
     "ts-node": "6.1.0",
-    "tslint": "5.20.1",
-    "tslint-eslint-rules": "5.4.0",
-    "tslint-language-service": "0.9.9",
-    "tslint-microsoft-contrib": "6.2.0",
     "typescript": "3.8.0-beta",
     "typescript": "3.8.0-beta",
     "webpack": "4.41.5",
     "webpack": "4.41.5",
     "webpack-cli": "3.3.10",
     "webpack-cli": "3.3.10",
@@ -102,7 +107,7 @@
     "test:mocha": "scripts/test-mocha",
     "test:mocha": "scripts/test-mocha",
     "test:removeTmpDir": "scripts/test-remove-tmp-dir",
     "test:removeTmpDir": "scripts/test-remove-tmp-dir",
     "test": "scripts/test",
     "test": "scripts/test",
-    "tslint": "scripts/tslint",
+    "eslint": "scripts/eslint",
     "travis": "scripts/travis",
     "travis": "scripts/travis",
     "git:addFiles": "scripts/git-add-files",
     "git:addFiles": "scripts/git-add-files",
     "postinstall": "opencollective || exit 0"
     "postinstall": "opencollective || exit 0"

+ 1 - 1
scripts/build

@@ -2,5 +2,5 @@
 
 
 yarn run removeCacheDir &&
 yarn run removeCacheDir &&
 yarn run webpack:prod &&
 yarn run webpack:prod &&
-yarn run tslint &&
+yarn run eslint &&
 yarn test
 yarn test

+ 3 - 0
scripts/eslint

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+$(yarn bin)/eslint src/**/*.ts

+ 1 - 1
scripts/travis

@@ -1,4 +1,4 @@
 #!/bin/bash
 #!/bin/bash
 
 
-yarn run tslint &&
+yarn run eslint &&
 yarn test
 yarn test

+ 0 - 3
scripts/tslint

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-$(yarn bin)/tslint src/**/*.ts --project src/tsconfig.node.json

+ 4 - 6
src/ASTParserFacade.ts

@@ -51,7 +51,7 @@ export class ASTParserFacade {
             }
             }
         }
         }
 
 
-        throw new Error(`Acorn parsing error`);
+        throw new Error('Acorn parsing error');
     }
     }
 
 
     /**
     /**
@@ -73,11 +73,9 @@ export class ASTParserFacade {
             sourceType
             sourceType
         };
         };
 
 
-        const program: ESTree.Program = (
-            <any>acorn
-                .Parser.extend(acornImportMeta)
-                .parse(sourceCode, config)
-        );
+        const program: ESTree.Program = <any>acorn
+            .Parser.extend(acornImportMeta)
+            .parse(sourceCode, config);
 
 
         if (comments.length) {
         if (comments.length) {
             program.comments = comments;
             program.comments = comments;

+ 1 - 1
src/JavaScriptObfuscator.ts

@@ -105,7 +105,7 @@ export class JavaScriptObfuscator implements IJavaScriptObfuscator {
      * @param {ILogger} logger
      * @param {ILogger} logger
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.ITransformersRunner) transformersRunner: ITransformersRunner,
         @inject(ServiceIdentifiers.ITransformersRunner) transformersRunner: ITransformersRunner,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.Factory__IObfuscatedCode) obfuscatedCodeFactory: TObfuscatedCodeFactory,
         @inject(ServiceIdentifiers.Factory__IObfuscatedCode) obfuscatedCodeFactory: TObfuscatedCodeFactory,

+ 1 - 1
src/JavaScriptObfuscatorFacade.ts

@@ -14,7 +14,7 @@ class JavaScriptObfuscatorFacade {
     /**
     /**
      * @type {string | undefined}
      * @type {string | undefined}
      */
      */
-    public static version: string = process.env.VERSION || 'unknown';
+    public static version: string = process.env.VERSION ?? 'unknown';
 
 
     /**
     /**
      * @param {string} sourceCode
      * @param {string} sourceCode

+ 1 - 1
src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts

@@ -72,7 +72,7 @@ export class CallsGraphAnalyzer implements ICallsGraphAnalyzer {
      */
      */
     private readonly calleeDataExtractorFactory: TCalleeDataExtractorFactory;
     private readonly calleeDataExtractorFactory: TCalleeDataExtractorFactory;
 
 
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICalleeDataExtractor) calleeDataExtractorFactory: TCalleeDataExtractorFactory
         @inject(ServiceIdentifiers.Factory__ICalleeDataExtractor) calleeDataExtractorFactory: TCalleeDataExtractorFactory
     ) {
     ) {
         this.calleeDataExtractorFactory = calleeDataExtractorFactory;
         this.calleeDataExtractorFactory = calleeDataExtractorFactory;

+ 1 - 1
src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts

@@ -36,7 +36,7 @@ export class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExt
 
 
         return {
         return {
             callee: calleeBlockStatement,
             callee: calleeBlockStatement,
-            name: callee.name || null
+            name: callee.name ?? null
         };
         };
     }
     }
 
 

+ 2 - 2
src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts

@@ -26,7 +26,7 @@ export class PrevailingKindOfVariablesAnalyzer implements IPrevailingKindOfVaria
      */
      */
     private prevailingKindOfVariables: ESTree.VariableDeclaration['kind'] = PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables;
     private prevailingKindOfVariables: ESTree.VariableDeclaration['kind'] = PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables;
 
 
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils
     ) {
     ) {
         this.arrayUtils = arrayUtils;
         this.arrayUtils = arrayUtils;
@@ -49,7 +49,7 @@ export class PrevailingKindOfVariablesAnalyzer implements IPrevailingKindOfVaria
         });
         });
 
 
         this.prevailingKindOfVariables = this.arrayUtils.findMostOccurringElement(variableKinds)
         this.prevailingKindOfVariables = this.arrayUtils.findMostOccurringElement(variableKinds)
-            || PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables;
+            ?? PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables;
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/analyzers/scope-analyzer/ScopeAnalyzer.ts

@@ -92,7 +92,7 @@ export class ScopeAnalyzer implements IScopeAnalyzer {
             }
             }
         }
         }
 
 
-        throw new Error(`Scope analyzing error`);
+        throw new Error('Scope analyzing error');
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts

@@ -49,7 +49,7 @@ export class StringArrayStorageAnalyzer implements IStringArrayStorageAnalyzer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions,
         @inject(ServiceIdentifiers.IOptions) options: IOptions,

+ 4 - 4
src/cli/JavaScriptObfuscatorCLI.ts

@@ -71,7 +71,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
     /**
     /**
      * @param {string[]} argv
      * @param {string[]} argv
      */
      */
-    constructor (argv: string[]) {
+    public constructor (argv: string[]) {
         this.rawArguments = argv;
         this.rawArguments = argv;
         this.arguments = argv.slice(2);
         this.arguments = argv.slice(2);
     }
     }
@@ -123,7 +123,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
     ): void {
     ): void {
         const outputSourceMapPath: string = CLIUtils.getOutputSourceMapPath(
         const outputSourceMapPath: string = CLIUtils.getOutputSourceMapPath(
             outputCodePath,
             outputCodePath,
-            options.sourceMapFileName || ''
+            options.sourceMapFileName ?? ''
         );
         );
 
 
         options = {
         options = {
@@ -189,7 +189,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
         this.commands
         this.commands
             .usage('<inputPath> [options]')
             .usage('<inputPath> [options]')
             .version(
             .version(
-                process.env.VERSION || 'unknown',
+                process.env.VERSION ?? 'unknown',
                 '-v, --version'
                 '-v, --version'
             )
             )
             .option(
             .option(
@@ -416,7 +416,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
 
 
         if (sourceCodeIndex !== null) {
         if (sourceCodeIndex !== null) {
             const baseIdentifiersPrefix: string = this.inputCLIOptions.identifiersPrefix
             const baseIdentifiersPrefix: string = this.inputCLIOptions.identifiersPrefix
-                || JavaScriptObfuscatorCLI.baseIdentifiersPrefix;
+                ?? JavaScriptObfuscatorCLI.baseIdentifiersPrefix;
             const identifiersPrefix: string = `${baseIdentifiersPrefix}${sourceCodeIndex}`;
             const identifiersPrefix: string = `${baseIdentifiersPrefix}${sourceCodeIndex}`;
 
 
             options = {
             options = {

+ 2 - 2
src/cli/sanitizers/ArraySanitizer.ts

@@ -5,8 +5,8 @@ import { TCLISanitizer } from '../../types/cli/TCLISanitizer';
  * @returns {string[]}
  * @returns {string[]}
  */
  */
 export const ArraySanitizer: TCLISanitizer <string[]> = (value: string): string[] => {
 export const ArraySanitizer: TCLISanitizer <string[]> = (value: string): string[] => {
-    if (/,$/.test(value)) {
-        throw new SyntaxError(`Multiple <list> values should be wrapped inside quotes: --option-name 'value1','value2'`);
+    if (value.endsWith(',')) {
+        throw new SyntaxError('Multiple <list> values should be wrapped inside quotes: --option-name \'value1\',\'value2\'');
     }
     }
 
 
     return value.split(',').map((string: string) => string.trim());
     return value.split(',').map((string: string) => string.trim());

+ 1 - 1
src/cli/utils/SourceCodeReader.ts

@@ -28,7 +28,7 @@ export class SourceCodeReader {
     /**
     /**
      * @param {TInputCLIOptions} options
      * @param {TInputCLIOptions} options
      */
      */
-    constructor (options: TInputCLIOptions) {
+    public constructor (options: TInputCLIOptions) {
         this.options = options;
         this.options = options;
     }
     }
 
 

+ 8 - 8
src/container/InversifyContainerFacade.ts

@@ -37,7 +37,7 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
      */
      */
     private readonly container: interfaces.Container;
     private readonly container: interfaces.Container;
 
 
-    constructor () {
+    public constructor () {
         this.container = new Container();
         this.container = new Container();
     }
     }
 
 
@@ -49,7 +49,7 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
         serviceIdentifier: interfaces.ServiceIdentifier<U>
         serviceIdentifier: interfaces.ServiceIdentifier<U>
     ): (context: interfaces.Context) => (bindingName: T) => U {
     ): (context: interfaces.Context) => (bindingName: T) => U {
         return (context: interfaces.Context): (bindingName: T) => U => {
         return (context: interfaces.Context): (bindingName: T) => U => {
-            return (bindingName: T) => {
+            return (bindingName: T): U => {
                 return context.container.getNamed<U>(serviceIdentifier, bindingName);
                 return context.container.getNamed<U>(serviceIdentifier, bindingName);
             };
             };
         };
         };
@@ -65,7 +65,7 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
         return (context: interfaces.Context): (bindingName: T) => U => {
         return (context: interfaces.Context): (bindingName: T) => U => {
             const cache: Map <T, U> = new Map();
             const cache: Map <T, U> = new Map();
 
 
-            return (bindingName: T) => {
+            return (bindingName: T): U => {
                 if (cache.has(bindingName)) {
                 if (cache.has(bindingName)) {
                     return <U>cache.get(bindingName);
                     return <U>cache.get(bindingName);
                 }
                 }
@@ -86,15 +86,15 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
      */
      */
     public static getConstructorFactory <T extends string, U> (
     public static getConstructorFactory <T extends string, U> (
         serviceIdentifier: interfaces.ServiceIdentifier<interfaces.Newable<U>>,
         serviceIdentifier: interfaces.ServiceIdentifier<interfaces.Newable<U>>,
-        ...dependencies: interfaces.ServiceIdentifier<interfaces.Newable<Object>>[]
+        ...dependencies: interfaces.ServiceIdentifier<interfaces.Newable<Record<string, any>>>[]
     ): (context: interfaces.Context) => (bindingName: T) => U {
     ): (context: interfaces.Context) => (bindingName: T) => U {
         return (context: interfaces.Context): (bindingName: T) => U => {
         return (context: interfaces.Context): (bindingName: T) => U => {
             const cache: Map<T, interfaces.Newable<U>> = new Map();
             const cache: Map<T, interfaces.Newable<U>> = new Map();
-            const cachedDependencies: Object[] = [];
+            const cachedDependencies: Record<string, any>[] = [];
 
 
-            return (bindingName: T) => {
+            return (bindingName: T): U => {
                 dependencies.forEach((
                 dependencies.forEach((
-                    dependency: interfaces.ServiceIdentifier<interfaces.Newable<Object>>,
+                    dependency: interfaces.ServiceIdentifier<interfaces.Newable<Record<string, any>>>,
                     index: number
                     index: number
                 ) => {
                 ) => {
                     if (!cachedDependencies[index]) {
                     if (!cachedDependencies[index]) {
@@ -174,7 +174,7 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
         this.container
         this.container
             .bind<IObfuscatedCode>(ServiceIdentifiers.Factory__IObfuscatedCode)
             .bind<IObfuscatedCode>(ServiceIdentifiers.Factory__IObfuscatedCode)
             .toFactory<IObfuscatedCode>((context: interfaces.Context) => {
             .toFactory<IObfuscatedCode>((context: interfaces.Context) => {
-                return (obfuscatedCodeAsString: string, sourceMapAsString: string) => {
+                return (obfuscatedCodeAsString: string, sourceMapAsString: string): IObfuscatedCode => {
                     const obfuscatedCode: IObfuscatedCode = context.container
                     const obfuscatedCode: IObfuscatedCode = context.container
                         .get<IObfuscatedCode>(ServiceIdentifiers.IObfuscatedCode);
                         .get<IObfuscatedCode>(ServiceIdentifiers.IObfuscatedCode);
 
 

+ 1 - 1
src/container/modules/custom-nodes/CustomNodesModule.ts

@@ -6,7 +6,7 @@ import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode';
 import { ICustomNodeFormatter } from '../../../interfaces/custom-nodes/ICustomNodeFormatter';
 import { ICustomNodeFormatter } from '../../../interfaces/custom-nodes/ICustomNodeFormatter';
 import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup';
 import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup';
 
 
-import { ControlFlowCustomNode } from "../../../enums/custom-nodes/ControlFlowCustomNode";
+import { ControlFlowCustomNode } from '../../../enums/custom-nodes/ControlFlowCustomNode';
 import { CustomNode } from '../../../enums/custom-nodes/CustomNode';
 import { CustomNode } from '../../../enums/custom-nodes/CustomNode';
 import { CustomNodeGroup } from '../../../enums/custom-nodes/CustomNodeGroup';
 import { CustomNodeGroup } from '../../../enums/custom-nodes/CustomNodeGroup';
 import { DeadCodeInjectionCustomNode } from '../../../enums/custom-nodes/DeadCodeInjectionCustomNode';
 import { DeadCodeInjectionCustomNode } from '../../../enums/custom-nodes/DeadCodeInjectionCustomNode';

+ 1 - 1
src/container/modules/generators/GeneratorsModule.ts

@@ -31,7 +31,7 @@ export const generatorsModule: interfaces.ContainerModule = new ContainerModule(
     function identifierNameGeneratorFactory (): (context: interfaces.Context) => (options: IOptions) => IIdentifierNamesGenerator {
     function identifierNameGeneratorFactory (): (context: interfaces.Context) => (options: IOptions) => IIdentifierNamesGenerator {
         let cachedIdentifierNamesGenerator: IIdentifierNamesGenerator | null = null;
         let cachedIdentifierNamesGenerator: IIdentifierNamesGenerator | null = null;
 
 
-        return (context: interfaces.Context): (options: IOptions) => IIdentifierNamesGenerator => (options: IOptions) => {
+        return (context: interfaces.Context): (options: IOptions) => IIdentifierNamesGenerator => (options: IOptions): IIdentifierNamesGenerator => {
             if (cachedIdentifierNamesGenerator) {
             if (cachedIdentifierNamesGenerator) {
                 return cachedIdentifierNamesGenerator;
                 return cachedIdentifierNamesGenerator;
             }
             }

+ 1 - 1
src/container/modules/node-transformers/PreparingTransformersModule.ts

@@ -17,7 +17,7 @@ import { MetadataTransformer } from '../../../node-transformers/preparing-transf
 import { ObfuscatingGuardsTransformer } from '../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer';
 import { ObfuscatingGuardsTransformer } from '../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer';
 import { ParentificationTransformer } from '../../../node-transformers/preparing-transformers/ParentificationTransformer';
 import { ParentificationTransformer } from '../../../node-transformers/preparing-transformers/ParentificationTransformer';
 import { ReservedStringObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard';
 import { ReservedStringObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard';
-import { VariablePreserveTransformer } from "../../../node-transformers/preparing-transformers/VariablePreserveTransformer";
+import { VariablePreserveTransformer } from '../../../node-transformers/preparing-transformers/VariablePreserveTransformer';
 
 
 export const preparingTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
 export const preparingTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
     // preparing transformers
     // preparing transformers

+ 1 - 1
src/container/modules/storages/StoragesModule.ts

@@ -28,7 +28,7 @@ export const storagesModule: interfaces.ContainerModule = new ContainerModule((b
     // controlFlowStorage factory
     // controlFlowStorage factory
     bind<TControlFlowStorage>(ServiceIdentifiers.Factory__TControlFlowStorage)
     bind<TControlFlowStorage>(ServiceIdentifiers.Factory__TControlFlowStorage)
         .toFactory<TControlFlowStorage>((context: interfaces.Context) => {
         .toFactory<TControlFlowStorage>((context: interfaces.Context) => {
-            return () => {
+            return (): TControlFlowStorage => {
                 const constructor: interfaces.Newable<TControlFlowStorage> = context.container
                 const constructor: interfaces.Newable<TControlFlowStorage> = context.container
                     .get<interfaces.Newable<TControlFlowStorage>>(ServiceIdentifiers.Newable__TControlFlowStorage);
                     .get<interfaces.Newable<TControlFlowStorage>>(ServiceIdentifiers.Newable__TControlFlowStorage);
                 const randomGenerator: IRandomGenerator = context.container
                 const randomGenerator: IRandomGenerator = context.container

+ 10 - 10
src/custom-nodes/AbstractCustomNode.ts

@@ -69,11 +69,6 @@ export abstract class AbstractCustomNode <
         this.options = options;
         this.options = options;
     }
     }
 
 
-    /**
-     * @param {TInitialData} args
-     */
-    public abstract initialize (...args: TInitialData): void;
-
     /**
     /**
      * @returns {TStatement[]}
      * @returns {TStatement[]}
      */
      */
@@ -98,15 +93,20 @@ export abstract class AbstractCustomNode <
             .pickone(AbstractCustomNode.globalVariableTemplateFunctions);
             .pickone(AbstractCustomNode.globalVariableTemplateFunctions);
     }
     }
 
 
-    /**
-     * @returns {TStatement[]}
-     */
-    protected abstract getNodeStructure (nodeTemplate: string): TStatement[];
-
     /**
     /**
      * @returns {string}
      * @returns {string}
      */
      */
     protected getNodeTemplate (): string {
     protected getNodeTemplate (): string {
         return '';
         return '';
     }
     }
+
+    /**
+     * @param {TInitialData} args
+     */
+    public abstract initialize (...args: TInitialData): void;
+
+    /**
+     * @returns {TStatement[]}
+     */
+    protected abstract getNodeStructure (nodeTemplate: string): TStatement[];
 }
 }

+ 19 - 19
src/custom-nodes/AbstractCustomNodeGroup.ts

@@ -16,16 +16,6 @@ import { ObfuscationEvent } from '../enums/event-emitters/ObfuscationEvent';
 
 
 @injectable()
 @injectable()
 export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
 export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
-    /**
-     * @type {ObfuscationEvent}
-     */
-    protected abstract readonly appendEvent: ObfuscationEvent;
-
-    /**
-     * @type {Map<CustomNode, ICustomNode>}
-     */
-    protected abstract customNodes: Map <CustomNode, ICustomNode>;
-
     /**
     /**
      * @type {IIdentifierNamesGenerator}
      * @type {IIdentifierNamesGenerator}
      */
      */
@@ -41,12 +31,22 @@ export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
      */
      */
     protected readonly randomGenerator: IRandomGenerator;
     protected readonly randomGenerator: IRandomGenerator;
 
 
+    /**
+     * @type {ObfuscationEvent}
+     */
+    protected abstract readonly appendEvent: ObfuscationEvent;
+
+    /**
+     * @type {Map<CustomNode, ICustomNode>}
+     */
+    protected abstract customNodes: Map <CustomNode, ICustomNode>;
+
     /**
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -57,12 +57,6 @@ export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
         this.options = options;
         this.options = options;
     }
     }
 
 
-    /**
-     * @param {TNodeWithStatements} nodeWithStatements
-     * @param {ICallsGraphData[]} callsGraphData
-     */
-    public abstract appendCustomNodes (nodeWithStatements: TNodeWithStatements, callsGraphData: ICallsGraphData[]): void;
-
     /**
     /**
      * @returns {ObfuscationEvent}
      * @returns {ObfuscationEvent}
      */
      */
@@ -77,8 +71,6 @@ export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
         return this.customNodes;
         return this.customNodes;
     }
     }
 
 
-    public abstract initialize (): void;
-
     /**
     /**
      * @param {CustomNode} customNodeName
      * @param {CustomNode} customNodeName
      * @param {callback} callback
      * @param {callback} callback
@@ -100,4 +92,12 @@ export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
     protected getRandomCallsGraphIndex (callsGraphLength: number): number {
     protected getRandomCallsGraphIndex (callsGraphLength: number): number {
         return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(callsGraphLength - 1)));
         return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(callsGraphLength - 1)));
     }
     }
+
+    /**
+     * @param {TNodeWithStatements} nodeWithStatements
+     * @param {ICallsGraphData[]} callsGraphData
+     */
+    public abstract appendCustomNodes (nodeWithStatements: TNodeWithStatements, callsGraphData: ICallsGraphData[]): void;
+
+    public abstract initialize (): void;
 }
 }

+ 1 - 1
src/custom-nodes/CustomNodeFormatter.ts

@@ -20,7 +20,7 @@ export class CustomNodeFormatter implements ICustomNodeFormatter {
      */
      */
     private readonly prevailingKindOfVariables: ESTree.VariableDeclaration['kind'];
     private readonly prevailingKindOfVariables: ESTree.VariableDeclaration['kind'];
 
 
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)
         @inject(ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)
             prevailingKindOfVariablesAnalyzer: IPrevailingKindOfVariablesAnalyzer
             prevailingKindOfVariablesAnalyzer: IPrevailingKindOfVariablesAnalyzer
     ) {
     ) {

+ 1 - 1
src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts

@@ -32,7 +32,7 @@ export class ConsoleOutputDisableExpressionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts

@@ -45,7 +45,7 @@ export class ConsoleOutputCustomNodeGroup extends AbstractCustomNodeGroup {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts

@@ -27,7 +27,7 @@ export class BinaryExpressionFunctionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts

@@ -43,7 +43,7 @@ export class BlockStatementControlFlowFlatteningNode extends AbstractCustomNode
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts

@@ -30,7 +30,7 @@ export class CallExpressionFunctionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts

@@ -27,7 +27,7 @@ export class LogicalExpressionFunctionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts

@@ -27,7 +27,7 @@ export class StringLiteralNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 2 - 2
src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts

@@ -7,7 +7,7 @@ import { TIdentifierNamesGeneratorFactory } from '../../../types/container/gener
 import { TStatement } from '../../../types/node/TStatement';
 import { TStatement } from '../../../types/node/TStatement';
 
 
 import { IOptions } from '../../../interfaces/options/IOptions';
 import { IOptions } from '../../../interfaces/options/IOptions';
-import { IRandomGenerator } from "../../../interfaces/utils/IRandomGenerator";
+import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
 import { ICustomNodeFormatter } from '../../../interfaces/custom-nodes/ICustomNodeFormatter';
 import { ICustomNodeFormatter } from '../../../interfaces/custom-nodes/ICustomNodeFormatter';
 
 
 import { initializable } from '../../../decorators/Initializable';
 import { initializable } from '../../../decorators/Initializable';
@@ -48,7 +48,7 @@ export class CallExpressionControlFlowStorageCallNode extends AbstractCustomNode
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts

@@ -33,7 +33,7 @@ export class ControlFlowStorageNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts

@@ -46,7 +46,7 @@ export class ExpressionWithOperatorControlFlowStorageCallNode extends AbstractCu
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts

@@ -34,7 +34,7 @@ export class StringLiteralControlFlowStorageCallNode extends AbstractCustomNode
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts

@@ -32,7 +32,7 @@ export class BlockStatementDeadCodeInjectionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts

@@ -35,7 +35,7 @@ export class DebugProtectionFunctionCallNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts

@@ -29,7 +29,7 @@ export class DebugProtectionFunctionIntervalNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts

@@ -33,7 +33,7 @@ export class DebugProtectionFunctionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts

@@ -48,7 +48,7 @@ export class DebugProtectionCustomNodeGroup extends AbstractCustomNodeGroup {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,

+ 2 - 2
src/custom-nodes/domain-lock-nodes/DomainLockNode.ts

@@ -39,7 +39,7 @@ export class DomainLockNode extends AbstractCustomNode {
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {ICryptUtils} cryptUtils
      * @param {ICryptUtils} cryptUtils
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
@@ -82,7 +82,7 @@ export class DomainLockNode extends AbstractCustomNode {
 
 
         return this.customNodeFormatter.formatTemplate(DomainLockNodeTemplate(), {
         return this.customNodeFormatter.formatTemplate(DomainLockNodeTemplate(), {
             domainLockFunctionName: this.identifierNamesGenerator.generate(),
             domainLockFunctionName: this.identifierNamesGenerator.generate(),
-            diff: diff,
+            diff,
             domains: hiddenDomainsString,
             domains: hiddenDomainsString,
             globalVariableTemplate,
             globalVariableTemplate,
             singleNodeCallControllerFunctionName: this.callsControllerFunctionName
             singleNodeCallControllerFunctionName: this.callsControllerFunctionName

+ 1 - 1
src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts

@@ -45,7 +45,7 @@ export class DomainLockCustomNodeGroup extends AbstractCustomNodeGroup {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,

+ 1 - 1
src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts

@@ -40,7 +40,7 @@ export class NodeCallsControllerFunctionNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts

@@ -26,7 +26,7 @@ export class ObjectExpressionVariableDeclarationHostNode extends AbstractCustomN
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts

@@ -39,7 +39,7 @@ export class SelfDefendingUnicodeNode extends AbstractCustomNode {
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts

@@ -45,7 +45,7 @@ export class SelfDefendingCustomNodeGroup extends AbstractCustomNodeGroup {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,

+ 1 - 1
src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts

@@ -54,7 +54,7 @@ export class StringArrayCallsWrapper extends AbstractCustomNode {
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/string-array-nodes/StringArrayNode.ts

@@ -36,7 +36,7 @@ export class StringArrayNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts

@@ -47,7 +47,7 @@ export class StringArrayRotateFunctionNode extends AbstractCustomNode {
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,
         @inject(ServiceIdentifiers.ICustomNodeFormatter) customNodeFormatter: ICustomNodeFormatter,

+ 1 - 1
src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts

@@ -53,7 +53,7 @@ export class StringArrayCustomNodeGroup extends AbstractCustomNodeGroup {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.Factory__ICustomNode) customNodeFactory: TCustomNodeFactory,
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)

+ 1 - 1
src/declarations/ESTree.d.ts

@@ -1,4 +1,4 @@
-/* tslint:disable:interface-name */
+/* eslint-disable */
 
 
 import * as acorn from 'acorn';
 import * as acorn from 'acorn';
 import * as escodegen from 'escodegen';
 import * as escodegen from 'escodegen';

+ 1 - 1
src/declarations/escodegen.d.ts

@@ -1,4 +1,4 @@
-/* tslint:disable:interface-name */
+/* eslint-disable */
 
 
 import * as ESTree from 'estree';
 import * as ESTree from 'estree';
 
 

+ 1 - 2
src/declarations/eslint-scope.d.ts

@@ -1,5 +1,4 @@
-/* tslint:disable:interface-name */
-/* tslint:disable:no-empty-interface */
+/* eslint-disable */
 
 
 import * as eslint from 'eslint';
 import * as eslint from 'eslint';
 import * as eslintScope from 'eslint-scope';
 import * as eslintScope from 'eslint-scope';

+ 4 - 6
src/decorators/Initializable.ts

@@ -1,5 +1,3 @@
-/* tslint:disable:no-invalid-this */
-
 import { IInitializable } from '../interfaces/IInitializable';
 import { IInitializable } from '../interfaces/IInitializable';
 
 
 const defaultDescriptor: PropertyDescriptor = {
 const defaultDescriptor: PropertyDescriptor = {
@@ -92,12 +90,12 @@ function wrapTargetMethodsInInitializedCheck (target: IInitializable, initialize
         }
         }
 
 
         const methodDescriptor: PropertyDescriptor = Object
         const methodDescriptor: PropertyDescriptor = Object
-            .getOwnPropertyDescriptor(target, propertyName) || defaultDescriptor;
+            .getOwnPropertyDescriptor(target, propertyName) ?? defaultDescriptor;
         const originalMethod: Function = methodDescriptor.value;
         const originalMethod: Function = methodDescriptor.value;
 
 
         Object.defineProperty(target, propertyName, {
         Object.defineProperty(target, propertyName, {
             ...methodDescriptor,
             ...methodDescriptor,
-            value: function (): void {
+            value (): void {
                 if (!Reflect.getMetadata(initializedTargetMetadataKey, this)) {
                 if (!Reflect.getMetadata(initializedTargetMetadataKey, this)) {
                     throw new Error(`Class should be initialized with \`${initializeMethodName}()\` method`);
                     throw new Error(`Class should be initialized with \`${initializeMethodName}()\` method`);
                 }
                 }
@@ -123,7 +121,7 @@ function wrapInitializeMethodInInitializeCheck (
     propertyKey: string | symbol
     propertyKey: string | symbol
 ): void {
 ): void {
     const methodDescriptor: PropertyDescriptor = Object
     const methodDescriptor: PropertyDescriptor = Object
-        .getOwnPropertyDescriptor(target, initializeMethodName) || defaultDescriptor;
+        .getOwnPropertyDescriptor(target, initializeMethodName) ?? defaultDescriptor;
     const originalMethod: Function = methodDescriptor.value;
     const originalMethod: Function = methodDescriptor.value;
 
 
     Object.defineProperty(target, initializeMethodName, {
     Object.defineProperty(target, initializeMethodName, {
@@ -159,7 +157,7 @@ function wrapInitializableProperty (target: IInitializable, propertyKey: string
 
 
     const initializablePropertyMetadataKey: string = `_${propertyKey.toString()}`;
     const initializablePropertyMetadataKey: string = `_${propertyKey.toString()}`;
     const propertyDescriptor: PropertyDescriptor = Object
     const propertyDescriptor: PropertyDescriptor = Object
-            .getOwnPropertyDescriptor(target, initializablePropertyMetadataKey) || defaultDescriptor;
+            .getOwnPropertyDescriptor(target, initializablePropertyMetadataKey) ?? defaultDescriptor;
 
 
     Object.defineProperty(target, propertyKey, {
     Object.defineProperty(target, propertyKey, {
         ...propertyDescriptor,
         ...propertyDescriptor,

+ 13 - 13
src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts

@@ -26,7 +26,7 @@ export abstract class AbstractIdentifierNamesGenerator implements IIdentifierNam
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -34,18 +34,6 @@ export abstract class AbstractIdentifierNamesGenerator implements IIdentifierNam
         this.options = options;
         this.options = options;
     }
     }
 
 
-    /**
-     * @param {number} nameLength
-     * @returns {string}
-     */
-    public abstract generate (nameLength?: number): string;
-
-    /**
-     * @param {number} nameLength
-     * @returns {string}
-     */
-    public abstract generateWithPrefix (nameLength?: number): string;
-
     /**
     /**
      * @param {string} name
      * @param {string} name
      * @returns {void}
      * @returns {void}
@@ -74,4 +62,16 @@ export abstract class AbstractIdentifierNamesGenerator implements IIdentifierNam
             : true;
             : true;
 
 
     }
     }
+
+    /**
+     * @param {number} nameLength
+     * @returns {string}
+     */
+    public abstract generate (nameLength?: number): string;
+
+    /**
+     * @param {number} nameLength
+     * @returns {string}
+     */
+    public abstract generateWithPrefix (nameLength?: number): string;
 }
 }

+ 1 - 1
src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts

@@ -29,7 +29,7 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {IArrayUtils} arrayUtils
      * @param {IArrayUtils} arrayUtils
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions,
         @inject(ServiceIdentifiers.IOptions) options: IOptions,
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils,
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils,

+ 1 - 1
src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts

@@ -24,7 +24,7 @@ export class HexadecimalIdentifierNamesGenerator extends AbstractIdentifierNames
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 1 - 1
src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts

@@ -38,7 +38,7 @@ export class MangledIdentifierNamesGenerator extends AbstractIdentifierNamesGene
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 0 - 1
src/interfaces/utils/ICryptUtils.ts

@@ -16,6 +16,5 @@ export interface ICryptUtils {
      * @param string
      * @param string
      * @returns {string}
      * @returns {string}
      */
      */
-    /* tslint:disable */
     rc4 (string: string, key: string): string;
     rc4 (string: string, key: string): string;
 }
 }

+ 2 - 2
src/logger/Logger.ts

@@ -34,7 +34,7 @@ export class Logger implements ILogger {
     /**
     /**
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
         this.options = options;
         this.options = options;
@@ -54,7 +54,7 @@ export class Logger implements ILogger {
     ): void {
     ): void {
         const processedMessage: string = loggingLevelColor(`\n${loggingPrefix} ${loggingMessage}`);
         const processedMessage: string = loggingLevelColor(`\n${loggingPrefix} ${loggingMessage}`);
 
 
-        console.log(processedMessage, value || '');
+        console.log(processedMessage, value ?? '');
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/node-transformers/AbstractNodeTransformer.ts

@@ -33,7 +33,7 @@ export abstract class AbstractNodeTransformer implements INodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 3 - 3
src/node-transformers/TransformersRunner.ts

@@ -45,7 +45,7 @@ export class TransformersRunner implements ITransformersRunner {
      * @param {TNodeTransformerFactory} nodeTransformerFactory
      * @param {TNodeTransformerFactory} nodeTransformerFactory
      * @param {INodeTransformerNamesGroupsBuilder} nodeTransformerNamesGroupsBuilder
      * @param {INodeTransformerNamesGroupsBuilder} nodeTransformerNamesGroupsBuilder
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__INodeTransformer)
         @inject(ServiceIdentifiers.Factory__INodeTransformer)
             nodeTransformerFactory: TNodeTransformerFactory,
             nodeTransformerFactory: TNodeTransformerFactory,
         @inject(ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)
         @inject(ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)
@@ -142,10 +142,10 @@ export class TransformersRunner implements ITransformersRunner {
         const visitorsLength: number = visitors.length;
         const visitorsLength: number = visitors.length;
 
 
         if (!visitorsLength) {
         if (!visitorsLength) {
-            return (node: ESTree.Node, parentNode: ESTree.Node | null) => node;
+            return (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node => node;
         }
         }
 
 
-        return (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+        return (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | estraverse.VisitorOption => {
             if (NodeMetadata.isIgnoredNode(node)) {
             if (NodeMetadata.isIgnoredNode(node)) {
                 return estraverse.VisitorOption.Skip;
                 return estraverse.VisitorOption.Skip;
             }
             }

+ 2 - 2
src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts

@@ -40,7 +40,7 @@ export class BlockStatementControlFlowTransformer extends AbstractNodeTransforme
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils,
         @inject(ServiceIdentifiers.IArrayUtils) arrayUtils: IArrayUtils,
@@ -104,7 +104,7 @@ export class BlockStatementControlFlowTransformer extends AbstractNodeTransforme
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.ControlFlowFlattening:
             case TransformationStage.ControlFlowFlattening:
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isBlockStatementNode(node)) {
                         if (parentNode && NodeGuards.isBlockStatementNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 2 - 2
src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts

@@ -88,7 +88,7 @@ export class FunctionControlFlowTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__TControlFlowStorage)
         @inject(ServiceIdentifiers.Factory__TControlFlowStorage)
             controlFlowStorageFactory: TControlFlowStorageFactory,
             controlFlowStorageFactory: TControlFlowStorageFactory,
         @inject(ServiceIdentifiers.Factory__IControlFlowReplacer)
         @inject(ServiceIdentifiers.Factory__IControlFlowReplacer)
@@ -113,7 +113,7 @@ export class FunctionControlFlowTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.ControlFlowFlattening:
             case TransformationStage.ControlFlowFlattening:
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (
                         if (
                             parentNode && (
                             parentNode && (
                                 NodeGuards.isFunctionDeclarationNode(node) ||
                                 NodeGuards.isFunctionDeclarationNode(node) ||

+ 9 - 9
src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts

@@ -38,7 +38,7 @@ export abstract class AbstractControlFlowReplacer implements IControlFlowReplace
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -69,14 +69,6 @@ export abstract class AbstractControlFlowReplacer implements IControlFlowReplace
         return storageKeysById;
         return storageKeysById;
     }
     }
 
 
-    /**
-     * @param {Node} node
-     * @param {Node} parentNode
-     * @param {TControlFlowStorage} controlFlowStorage
-     * @returns {Node}
-     */
-    public abstract replace (node: ESTree.Node, parentNode: ESTree.Node, controlFlowStorage: TControlFlowStorage): ESTree.Node;
-
     /**
     /**
      * @param {ICustomNode} customNode
      * @param {ICustomNode} customNode
      * @param {TControlFlowStorage} controlFlowStorage
      * @param {TControlFlowStorage} controlFlowStorage
@@ -120,4 +112,12 @@ export abstract class AbstractControlFlowReplacer implements IControlFlowReplace
 
 
         return storageKey;
         return storageKey;
     }
     }
+
+    /**
+     * @param {Node} node
+     * @param {Node} parentNode
+     * @param {TControlFlowStorage} controlFlowStorage
+     * @returns {Node}
+     */
+    public abstract replace (node: ESTree.Node, parentNode: ESTree.Node, controlFlowStorage: TControlFlowStorage): ESTree.Node;
 }
 }

+ 1 - 1
src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts

@@ -28,7 +28,7 @@ export class BinaryExpressionControlFlowReplacer extends ExpressionWithOperatorC
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,

+ 2 - 2
src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts

@@ -31,7 +31,7 @@ export class CallExpressionControlFlowReplacer extends AbstractControlFlowReplac
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -100,7 +100,7 @@ export class CallExpressionControlFlowReplacer extends AbstractControlFlowReplac
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
 
 
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
-            throw new Error(`\`controlFlowStorageCallCustomNode.getNode()[0]\` should returns array with \`ExpressionStatement\` node`);
+            throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node');
         }
         }
 
 
         return statementNode.expression;
         return statementNode.expression;

+ 2 - 2
src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts

@@ -24,7 +24,7 @@ export abstract class ExpressionWithOperatorControlFlowReplacer extends Abstract
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -54,7 +54,7 @@ export abstract class ExpressionWithOperatorControlFlowReplacer extends Abstract
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
 
 
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
-            throw new Error(`\`controlFlowStorageCallCustomNode.getNode()[0]\` should returns array with \`ExpressionStatement\` node`);
+            throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node');
         }
         }
 
 
         return statementNode.expression;
         return statementNode.expression;

+ 1 - 1
src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts

@@ -30,7 +30,7 @@ export class LogicalExpressionControlFlowReplacer extends ExpressionWithOperator
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,

+ 2 - 2
src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts

@@ -31,7 +31,7 @@ export class StringLiteralControlFlowReplacer extends AbstractControlFlowReplace
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
         @inject(ServiceIdentifiers.Factory__IControlFlowCustomNode)
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
             controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -92,7 +92,7 @@ export class StringLiteralControlFlowReplacer extends AbstractControlFlowReplace
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
         const statementNode: TStatement = controlFlowStorageCallCustomNode.getNode()[0];
 
 
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
         if (!statementNode || !NodeGuards.isExpressionStatementNode(statementNode)) {
-            throw new Error(`\`controlFlowStorageCallCustomNode.getNode()[0]\` should returns array with \`ExpressionStatement\` node`);
+            throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node');
         }
         }
 
 
         return statementNode.expression;
         return statementNode.expression;

+ 2 - 2
src/node-transformers/converting-transformers/MemberExpressionTransformer.ts

@@ -19,7 +19,7 @@ export class MemberExpressionTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -34,7 +34,7 @@ export class MemberExpressionTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isMemberExpressionNode(node)) {
                         if (parentNode && NodeGuards.isMemberExpressionNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 2 - 2
src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts

@@ -36,7 +36,7 @@ export class MethodDefinitionTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -51,7 +51,7 @@ export class MethodDefinitionTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isMethodDefinitionNode(node)) {
                         if (parentNode && NodeGuards.isMethodDefinitionNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 2 - 2
src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts

@@ -37,7 +37,7 @@ export class ObjectExpressionKeysTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IObjectExpressionExtractor)
         @inject(ServiceIdentifiers.Factory__IObjectExpressionExtractor)
             objectExpressionExtractorFactory: TObjectExpressionExtractorFactory,
             objectExpressionExtractorFactory: TObjectExpressionExtractorFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -122,7 +122,7 @@ export class ObjectExpressionKeysTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (
                         if (
                             parentNode
                             parentNode
                             && NodeGuards.isObjectExpressionNode(node)
                             && NodeGuards.isObjectExpressionNode(node)

+ 2 - 2
src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts

@@ -26,7 +26,7 @@ export class ObjectExpressionTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -41,7 +41,7 @@ export class ObjectExpressionTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isObjectExpressionNode(node)) {
                         if (parentNode && NodeGuards.isObjectExpressionNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 3 - 3
src/node-transformers/converting-transformers/SplitStringTransformer.ts

@@ -39,7 +39,7 @@ export class SplitStringTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -76,7 +76,7 @@ export class SplitStringTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (!this.options.splitStrings) {
                         if (!this.options.splitStrings) {
                             return;
                             return;
                         }
                         }
@@ -114,7 +114,7 @@ export class SplitStringTransformer extends AbstractNodeTransformer {
 
 
         // pass #2: split large chunks on a chunks with length of `splitStringsChunkLength`
         // pass #2: split large chunks on a chunks with length of `splitStringsChunkLength`
         const secondPassChunksNode: ESTree.Node = estraverse.replace(firstPassChunksNode, {
         const secondPassChunksNode: ESTree.Node = estraverse.replace(firstPassChunksNode, {
-            /* tslint:disable:no-shadowed-variable */
+            // eslint-disable-next-line no-shadow
             enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
             enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
                 if (parentNode && NodeGuards.isLiteralNode(node)) {
                 if (parentNode && NodeGuards.isLiteralNode(node)) {
                     return this.transformLiteralNodeByChunkLength(
                     return this.transformLiteralNodeByChunkLength(

+ 4 - 4
src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts

@@ -24,7 +24,7 @@ export class TemplateLiteralTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -35,8 +35,8 @@ export class TemplateLiteralTransformer extends AbstractNodeTransformer {
      * @param {NodeGuards} node
      * @param {NodeGuards} node
      * @returns {boolean}
      * @returns {boolean}
      */
      */
-    private static isLiteralNodeWithStringValue (node: ESTree.Node): boolean {
-        return node && NodeGuards.isLiteralNode(node) && typeof node.value === 'string';
+    private static isLiteralNodeWithStringValue (node: ESTree.Node | undefined): boolean {
+        return !!node && NodeGuards.isLiteralNode(node) && typeof node.value === 'string';
     }
     }
 
 
     /**
     /**
@@ -56,7 +56,7 @@ export class TemplateLiteralTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Converting:
             case TransformationStage.Converting:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && TemplateLiteralTransformer.isValidTemplateLiteralNode(node, parentNode)) {
                         if (parentNode && TemplateLiteralTransformer.isValidTemplateLiteralNode(node, parentNode)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 4 - 4
src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts

@@ -30,7 +30,7 @@ export class ObjectExpressionToVariableDeclarationExtractor implements IObjectEx
     /**
     /**
      * @param {TObjectExpressionKeysTransformerCustomNodeFactory} objectExpressionKeysTransformerCustomNodeFactory
      * @param {TObjectExpressionKeysTransformerCustomNodeFactory} objectExpressionKeysTransformerCustomNodeFactory
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)
         @inject(ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)
             objectExpressionKeysTransformerCustomNodeFactory: TObjectExpressionKeysTransformerCustomNodeFactory,
             objectExpressionKeysTransformerCustomNodeFactory: TObjectExpressionKeysTransformerCustomNodeFactory,
     ) {
     ) {
@@ -112,7 +112,7 @@ export class ObjectExpressionToVariableDeclarationExtractor implements IObjectEx
             !statementNode
             !statementNode
             || !NodeGuards.isVariableDeclarationNode(statementNode)
             || !NodeGuards.isVariableDeclarationNode(statementNode)
         ) {
         ) {
-            throw new Error(`\`objectExpressionHostCustomNode.getNode()[0]\` should returns array with \`VariableDeclaration\` node`);
+            throw new Error('`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node');
         }
         }
 
 
         return statementNode;
         return statementNode;
@@ -126,7 +126,7 @@ export class ObjectExpressionToVariableDeclarationExtractor implements IObjectEx
         const newObjectExpressionIdentifierNode: ESTree.Pattern = objectExpressionHostNode.declarations[0].id;
         const newObjectExpressionIdentifierNode: ESTree.Pattern = objectExpressionHostNode.declarations[0].id;
 
 
         if (!NodeGuards.isIdentifierNode(newObjectExpressionIdentifierNode)) {
         if (!NodeGuards.isIdentifierNode(newObjectExpressionIdentifierNode)) {
-            throw new Error(`\`objectExpressionHostNode\` should contain \`VariableDeclarator\` node with \`Identifier\` id property`);
+            throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property');
         }
         }
 
 
         return newObjectExpressionIdentifierNode;
         return newObjectExpressionIdentifierNode;
@@ -140,7 +140,7 @@ export class ObjectExpressionToVariableDeclarationExtractor implements IObjectEx
         const newObjectExpressionNode: ESTree.Expression | null = objectExpressionHostNode.declarations[0].init ?? null;
         const newObjectExpressionNode: ESTree.Expression | null = objectExpressionHostNode.declarations[0].init ?? null;
 
 
         if (!newObjectExpressionNode || !NodeGuards.isObjectExpressionNode(newObjectExpressionNode)) {
         if (!newObjectExpressionNode || !NodeGuards.isObjectExpressionNode(newObjectExpressionNode)) {
-            throw new Error(`\`objectExpressionHostNode\` should contain \`VariableDeclarator\` node with \`ObjectExpression\` init property`);
+            throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property');
         }
         }
 
 
         return newObjectExpressionNode;
         return newObjectExpressionNode;

+ 10 - 4
src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts

@@ -82,7 +82,7 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)
         @inject(ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)
             deadCodeInjectionCustomNodeFactory: TDeadNodeInjectionCustomNodeFactory,
             deadCodeInjectionCustomNodeFactory: TDeadNodeInjectionCustomNodeFactory,
         @inject(ServiceIdentifiers.ITransformersRunner) transformersRunner: ITransformersRunner,
         @inject(ServiceIdentifiers.ITransformersRunner) transformersRunner: ITransformersRunner,
@@ -216,14 +216,17 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.DeadCodeInjection:
             case TransformationStage.DeadCodeInjection:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isProgramNode(node)) {
                         if (parentNode && NodeGuards.isProgramNode(node)) {
                             this.analyzeNode(node, parentNode);
                             this.analyzeNode(node, parentNode);
 
 
                             return node;
                             return node;
                         }
                         }
                     },
                     },
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (
+                        node: ESTree.Node,
+                        parentNode: ESTree.Node | null
+                    ): ESTree.Node | estraverse.VisitorOption | undefined => {
                         if (parentNode && NodeGuards.isBlockStatementNode(node)) {
                         if (parentNode && NodeGuards.isBlockStatementNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }
@@ -236,7 +239,10 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
                 }
                 }
 
 
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (
+                        node: ESTree.Node,
+                        parentNode: ESTree.Node | null
+                    ): ESTree.Node | estraverse.VisitorOption |undefined => {
                         if (parentNode && this.isDeadCodeInjectionRootAstHostNode(node)) {
                         if (parentNode && this.isDeadCodeInjectionRootAstHostNode(node)) {
                             return this.restoreNode(node, parentNode);
                             return this.restoreNode(node, parentNode);
                         }
                         }

+ 2 - 2
src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts

@@ -47,7 +47,7 @@ export class LabeledStatementTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -68,7 +68,7 @@ export class LabeledStatementTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Obfuscating:
             case TransformationStage.Obfuscating:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isLabeledStatementNode(node)) {
                         if (parentNode && NodeGuards.isLabeledStatementNode(node)) {
                             return this.transformNode(node, parentNode);
                             return this.transformNode(node, parentNode);
                         }
                         }

+ 3 - 3
src/node-transformers/obfuscating-transformers/LiteralTransformer.ts

@@ -45,7 +45,7 @@ export class LiteralTransformer extends AbstractNodeTransformer {
      * @param {IStringArrayStorageAnalyzer} stringArrayStorageAnalyzer
      * @param {IStringArrayStorageAnalyzer} stringArrayStorageAnalyzer
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      * @param {IEscapeSequenceEncoder} escapeSequenceEncoder
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IObfuscatingReplacer)
         @inject(ServiceIdentifiers.Factory__IObfuscatingReplacer)
             literalObfuscatingReplacerFactory: TLiteralObfuscatingReplacerFactory,
             literalObfuscatingReplacerFactory: TLiteralObfuscatingReplacerFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -68,7 +68,7 @@ export class LiteralTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Obfuscating:
             case TransformationStage.Obfuscating:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (NodeGuards.isProgramNode(node)) {
                         if (NodeGuards.isProgramNode(node)) {
                             this.analyzeNode(node);
                             this.analyzeNode(node);
                         }
                         }
@@ -81,7 +81,7 @@ export class LiteralTransformer extends AbstractNodeTransformer {
 
 
             case TransformationStage.Finalizing:
             case TransformationStage.Finalizing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isLiteralNode(node)) {
                         if (parentNode && NodeGuards.isLiteralNode(node)) {
                             return this.encodeLiteralNodeToEscapeSequence(node, parentNode);
                             return this.encodeLiteralNodeToEscapeSequence(node, parentNode);
                         }
                         }

+ 2 - 2
src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts

@@ -60,7 +60,7 @@ export class ScopeIdentifiersTransformer extends AbstractNodeTransformer {
      * @param {IOptions} options
      * @param {IOptions} options
      * @param {IScopeAnalyzer} scopeAnalyzer
      * @param {IScopeAnalyzer} scopeAnalyzer
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -83,7 +83,7 @@ export class ScopeIdentifiersTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Obfuscating:
             case TransformationStage.Obfuscating:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && NodeGuards.isProgramNode(node)) {
                         if (parentNode && NodeGuards.isProgramNode(node)) {
                             this.analyzeNode(node, parentNode);
                             this.analyzeNode(node, parentNode);
 
 

+ 1 - 1
src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts

@@ -18,7 +18,7 @@ export abstract class AbstractObfuscatingReplacer implements IObfuscatingReplace
     /**
     /**
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
         this.options = options;
         this.options = options;

+ 1 - 1
src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts

@@ -29,7 +29,7 @@ export class BaseIdentifierObfuscatingReplacer extends AbstractObfuscatingReplac
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions

+ 1 - 1
src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts

@@ -13,7 +13,7 @@ export class BooleanLiteralObfuscatingReplacer extends AbstractObfuscatingReplac
     /**
     /**
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
         super(options);
         super(options);

+ 1 - 1
src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts

@@ -20,7 +20,7 @@ export class NumberLiteralObfuscatingReplacer extends AbstractObfuscatingReplace
     /**
     /**
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
         super(options);
         super(options);

+ 1 - 1
src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts

@@ -47,7 +47,7 @@ export class StringLiteralObfuscatingReplacer extends AbstractObfuscatingReplace
      * @param {IStringArrayStorageAnalyzer} stringArrayStorageAnalyzer
      * @param {IStringArrayStorageAnalyzer} stringArrayStorageAnalyzer
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.TStringArrayStorage) stringArrayStorage: IStringArrayStorage,
         @inject(ServiceIdentifiers.IStringArrayStorageAnalyzer) stringArrayStorageAnalyzer: IStringArrayStorageAnalyzer,
         @inject(ServiceIdentifiers.IStringArrayStorageAnalyzer) stringArrayStorageAnalyzer: IStringArrayStorageAnalyzer,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions

+ 4 - 4
src/node-transformers/preparing-transformers/CommentsTransformer.ts

@@ -2,7 +2,7 @@ import { inject, injectable, } from 'inversify';
 import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
 import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
 
 
 import * as ESTree from 'estree';
 import * as ESTree from 'estree';
-import * as estraverse from "estraverse";
+import * as estraverse from 'estraverse';
 
 
 import { IOptions } from '../../interfaces/options/IOptions';
 import { IOptions } from '../../interfaces/options/IOptions';
 import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
 import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
@@ -12,7 +12,7 @@ import { TransformationStage } from '../../enums/node-transformers/Transformatio
 
 
 import { AbstractNodeTransformer } from '../AbstractNodeTransformer';
 import { AbstractNodeTransformer } from '../AbstractNodeTransformer';
 import { NodeGuards } from '../../node/NodeGuards';
 import { NodeGuards } from '../../node/NodeGuards';
-import { ConditionalCommentObfuscatingGuard } from "./obfuscating-guards/ConditionalCommentObfuscatingGuard";
+import { ConditionalCommentObfuscatingGuard } from './obfuscating-guards/ConditionalCommentObfuscatingGuard';
 
 
 @injectable()
 @injectable()
 export class CommentsTransformer extends AbstractNodeTransformer {
 export class CommentsTransformer extends AbstractNodeTransformer {
@@ -28,7 +28,7 @@ export class CommentsTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -43,7 +43,7 @@ export class CommentsTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Initializing:
             case TransformationStage.Initializing:
                 return {
                 return {
-                    leave: (node: ESTree.Node) => {
+                    leave: (node: ESTree.Node): ESTree.Node | undefined => {
                         if (NodeGuards.isProgramNode(node)) {
                         if (NodeGuards.isProgramNode(node)) {
                             return this.transformNode(node);
                             return this.transformNode(node);
                         }
                         }

+ 3 - 3
src/node-transformers/preparing-transformers/CustomNodesTransformer.ts

@@ -58,7 +58,7 @@ export class CustomNodesTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.ICallsGraphAnalyzer) callsGraphAnalyzer: ICallsGraphAnalyzer,
         @inject(ServiceIdentifiers.ICallsGraphAnalyzer) callsGraphAnalyzer: ICallsGraphAnalyzer,
         @inject(ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)
         @inject(ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)
             prevailingKindOfVariablesAnalyzer: IPrevailingKindOfVariablesAnalyzer,
             prevailingKindOfVariablesAnalyzer: IPrevailingKindOfVariablesAnalyzer,
@@ -83,7 +83,7 @@ export class CustomNodesTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (NodeGuards.isProgramNode(node)) {
                         if (NodeGuards.isProgramNode(node)) {
                             this.analyzeNode(node, parentNode);
                             this.analyzeNode(node, parentNode);
                             this.appendCustomNodesBeforeObfuscation(node, parentNode);
                             this.appendCustomNodesBeforeObfuscation(node, parentNode);
@@ -95,7 +95,7 @@ export class CustomNodesTransformer extends AbstractNodeTransformer {
 
 
             case TransformationStage.Finalizing:
             case TransformationStage.Finalizing:
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                         if (NodeGuards.isProgramNode(node)) {
                         if (NodeGuards.isProgramNode(node)) {
                             this.appendCustomNodesAfterObfuscation(node, parentNode);
                             this.appendCustomNodesAfterObfuscation(node, parentNode);
                         }
                         }

+ 4 - 4
src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts

@@ -26,7 +26,7 @@ export class EvalCallExpressionTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -82,7 +82,7 @@ export class EvalCallExpressionTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (
                         if (
                             parentNode
                             parentNode
                             && NodeGuards.isCallExpressionNode(node)
                             && NodeGuards.isCallExpressionNode(node)
@@ -100,7 +100,7 @@ export class EvalCallExpressionTransformer extends AbstractNodeTransformer {
                 }
                 }
 
 
                 return {
                 return {
-                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    leave: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (parentNode && this.isEvalRootAstHostNode(node)) {
                         if (parentNode && this.isEvalRootAstHostNode(node)) {
                             return this.restoreNode(node, parentNode);
                             return this.restoreNode(node, parentNode);
                         }
                         }
@@ -118,7 +118,7 @@ export class EvalCallExpressionTransformer extends AbstractNodeTransformer {
      * @returns {Node}
      * @returns {Node}
      */
      */
     public transformNode (callExpressionNode: ESTree.CallExpression, parentNode: ESTree.Node): ESTree.Node {
     public transformNode (callExpressionNode: ESTree.CallExpression, parentNode: ESTree.Node): ESTree.Node {
-        const callExpressionFirstArgument: ESTree.Expression | ESTree.SpreadElement = callExpressionNode.arguments[0];
+        const callExpressionFirstArgument: ESTree.Expression | ESTree.SpreadElement | undefined = callExpressionNode.arguments[0];
 
 
         if (!callExpressionFirstArgument) {
         if (!callExpressionFirstArgument) {
             return callExpressionNode;
             return callExpressionNode;

+ 2 - 2
src/node-transformers/preparing-transformers/MetadataTransformer.ts

@@ -22,7 +22,7 @@ export class MetadataTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -37,7 +37,7 @@ export class MetadataTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         return this.transformNode(node, parentNode);
                         return this.transformNode(node, parentNode);
                     }
                     }
                 };
                 };

+ 2 - 2
src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts

@@ -40,7 +40,7 @@ export class ObfuscatingGuardsTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__INodeGuard) obfuscatingGuardFactory: TObfuscatingGuardFactory,
         @inject(ServiceIdentifiers.Factory__INodeGuard) obfuscatingGuardFactory: TObfuscatingGuardFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
@@ -58,7 +58,7 @@ export class ObfuscatingGuardsTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         return this.transformNode(node, parentNode);
                         return this.transformNode(node, parentNode);
                     }
                     }
                 };
                 };

+ 2 - 2
src/node-transformers/preparing-transformers/ParentificationTransformer.ts

@@ -21,7 +21,7 @@ export class ParentificationTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
@@ -36,7 +36,7 @@ export class ParentificationTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         return this.transformNode(node, parentNode);
                         return this.transformNode(node, parentNode);
                     }
                     }
                 };
                 };

+ 3 - 3
src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts

@@ -7,7 +7,7 @@ import { IIdentifierObfuscatingReplacer } from '../../interfaces/node-transforme
 import { IOptions } from '../../interfaces/options/IOptions';
 import { IOptions } from '../../interfaces/options/IOptions';
 import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
 import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
 import { IVisitor } from '../../interfaces/node-transformers/IVisitor';
 import { IVisitor } from '../../interfaces/node-transformers/IVisitor';
-import { IdentifierObfuscatingReplacer } from "../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer";
+import { IdentifierObfuscatingReplacer } from '../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer';
 
 
 import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
 import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
 import { TransformationStage } from '../../enums/node-transformers/TransformationStage';
 import { TransformationStage } from '../../enums/node-transformers/TransformationStage';
@@ -30,7 +30,7 @@ export class VariablePreserveTransformer extends AbstractNodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
         @inject(ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
             identifierObfuscatingReplacerFactory: TIdentifierObfuscatingReplacerFactory,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
@@ -51,7 +51,7 @@ export class VariablePreserveTransformer extends AbstractNodeTransformer {
         switch (transformationStage) {
         switch (transformationStage) {
             case TransformationStage.Preparing:
             case TransformationStage.Preparing:
                 return {
                 return {
-                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
+                    enter: (node: ESTree.Node, parentNode: ESTree.Node | null): ESTree.Node | undefined => {
                         if (
                         if (
                             NodeGuards.isIdentifierNode(node)
                             NodeGuards.isIdentifierNode(node)
                             && parentNode
                             && parentNode

+ 1 - 1
src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts

@@ -22,7 +22,7 @@ export class BlackListObfuscatingGuard implements IObfuscatingGuard {
      */
      */
     private readonly blackListGuardsLength: number;
     private readonly blackListGuardsLength: number;
 
 
-    constructor () {
+    public constructor () {
         this.blackListGuardsLength = BlackListObfuscatingGuard.blackListGuards.length;
         this.blackListGuardsLength = BlackListObfuscatingGuard.blackListGuards.length;
     }
     }
 
 

+ 1 - 1
src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts

@@ -19,7 +19,7 @@ export class ReservedStringObfuscatingGuard implements IObfuscatingGuard {
     /**
     /**
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {
         this.options = options;
         this.options = options;

Неке датотеке нису приказане због велике количине промена