فهرست منبع

Update to typescript 2.7.1 #2

sanex3339 7 سال پیش
والد
کامیت
8b01f151bd
41فایلهای تغییر یافته به همراه91 افزوده شده و 108 حذف شده
  1. 0 0
      dist/index.js
  2. 2 2
      src/ObfuscationResult.ts
  3. 3 3
      src/cli/JavaScriptObfuscatorCLI.ts
  4. 2 2
      src/custom-nodes/AbstractCustomNode.ts
  5. 0 5
      src/custom-nodes/AbstractCustomNodeGroup.ts
  6. 1 1
      src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts
  7. 1 1
      src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts
  8. 1 1
      src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts
  9. 3 3
      src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts
  10. 1 1
      src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts
  11. 1 1
      src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts
  12. 1 1
      src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts
  13. 4 4
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts
  14. 1 1
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts
  15. 4 4
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts
  16. 2 2
      src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts
  17. 2 2
      src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts
  18. 2 2
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts
  19. 1 1
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts
  20. 1 1
      src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts
  21. 1 1
      src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts
  22. 1 1
      src/custom-nodes/domain-lock-nodes/DomainLockNode.ts
  23. 1 1
      src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts
  24. 2 2
      src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts
  25. 1 1
      src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts
  26. 1 1
      src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts
  27. 2 2
      src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts
  28. 3 3
      src/custom-nodes/string-array-nodes/StringArrayNode.ts
  29. 2 2
      src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts
  30. 1 2
      src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts
  31. 3 3
      src/logger/Logger.ts
  32. 1 1
      src/node-transformers/AbstractNodeTransformer.ts
  33. 0 10
      src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts
  34. 1 1
      src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts
  35. 1 1
      src/node-transformers/preparing-transformers/CustomNodesTransformer.ts
  36. 27 27
      src/options/Options.ts
  37. 2 2
      src/storages/ArrayStorage.ts
  38. 2 2
      src/storages/MapStorage.ts
  39. 2 2
      src/utils/RandomGenerator.ts
  40. 4 4
      test/unit-tests/decorators/initializable/Initializable.spec.ts
  41. 0 1
      tsconfig.json

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/index.js


+ 2 - 2
src/ObfuscationResult.ts

@@ -10,13 +10,13 @@ export class ObfuscationResult implements IObfuscationResult {
      * @type {string}
      */
     @initializable()
-    private obfuscatedCode: string;
+    private obfuscatedCode!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private sourceMap: string;
+    private sourceMap!: string;
 
     /**
      * @param {string} obfuscatedCode

+ 3 - 3
src/cli/JavaScriptObfuscatorCLI.ts

@@ -63,19 +63,19 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
      * @type {commander.CommanderStatic}
      */
     @initializable()
-    private commands: commander.CommanderStatic;
+    private commands!: commander.CommanderStatic;
 
     /**
      * @type {TInputCLIOptions}
      */
     @initializable()
-    private inputCLIOptions: TInputCLIOptions;
+    private inputCLIOptions!: TInputCLIOptions;
 
     /**
      * @type {string}
      */
     @initializable()
-    private inputPath: string;
+    private inputPath!: string;
 
     /**
      * @param {string[]} argv

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

@@ -23,9 +23,9 @@ export abstract class AbstractCustomNode implements ICustomNode {
     ];
 
     /**
-     * @type {TStatement[]}
+     * @type {TStatement[] | null}
      */
-    protected cachedNode: TStatement[];
+    protected cachedNode: TStatement[] | null = null;
 
     /**
      * @type {IIdentifierNamesGenerator}

+ 0 - 5
src/custom-nodes/AbstractCustomNodeGroup.ts

@@ -41,11 +41,6 @@ export abstract class AbstractCustomNodeGroup implements ICustomNodeGroup {
      */
     protected readonly randomGenerator: IRandomGenerator;
 
-    /**
-     * @type {IStackTraceData[]}
-     */
-    protected readonly stackTraceData: IStackTraceData[];
-
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
      * @param {IRandomGenerator} randomGenerator

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

@@ -25,7 +25,7 @@ export class ConsoleOutputDisableExpressionNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private callsControllerFunctionName: string;
+    private callsControllerFunctionName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -29,7 +29,7 @@ export class ConsoleOutputCustomNodeGroup extends AbstractCustomNodeGroup {
      * @type {Map<CustomNode, ICustomNode>}
      */
     @initializable()
-    protected customNodes: Map <CustomNode, ICustomNode>;
+    protected customNodes!: Map <CustomNode, ICustomNode>;
 
     /**
      * @type {TCustomNodeFactory}

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

@@ -21,7 +21,7 @@ export class BinaryExpressionFunctionNode extends AbstractCustomNode {
      * @type {BinaryOperator}
      */
     @initializable()
-    private operator: BinaryOperator;
+    private operator!: BinaryOperator;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -22,19 +22,19 @@ export class BlockStatementControlFlowFlatteningNode extends AbstractCustomNode
      * @type {ESTree.Statement[]}
      */
     @initializable()
-    private blockStatementBody: ESTree.Statement[];
+    private blockStatementBody!: ESTree.Statement[];
 
     /**
      * @type {number[]}
      */
     @initializable()
-    private originalKeysIndexesInShuffledArray: number[];
+    private originalKeysIndexesInShuffledArray!: number[];
 
     /**
      * @type {number[]}
      */
     @initializable()
-    private shuffledKeys: number[];
+    private shuffledKeys!: number[];
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -21,7 +21,7 @@ export class CallExpressionFunctionNode extends AbstractCustomNode {
      * @type {(ESTree.Expression | ESTree.SpreadElement)[]}
      */
     @initializable()
-    private expressionArguments: (ESTree.Expression | ESTree.SpreadElement)[];
+    private expressionArguments!: (ESTree.Expression | ESTree.SpreadElement)[];
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -21,7 +21,7 @@ export class LogicalExpressionFunctionNode extends AbstractCustomNode {
      * @type {LogicalOperator}
      */
     @initializable()
-    private operator: LogicalOperator;
+    private operator!: LogicalOperator;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -18,7 +18,7 @@ export class StringLiteralNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private literalValue: string;
+    private literalValue!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -22,25 +22,25 @@ export class CallExpressionControlFlowStorageCallNode extends AbstractCustomNode
      * @type {Expression}
      */
     @initializable()
-    private callee: Expression;
+    private callee!: Expression;
 
     /**
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageKey: string;
+    private controlFlowStorageKey!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageName: string;
+    private controlFlowStorageName!: string;
 
     /**
      * @type {(ESTree.Expression | ESTree.SpreadElement)[]}
      */
     @initializable()
-    private expressionArguments: (ESTree.Expression | ESTree.SpreadElement)[];
+    private expressionArguments!: (ESTree.Expression | ESTree.SpreadElement)[];
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -24,7 +24,7 @@ export class ControlFlowStorageNode extends AbstractCustomNode {
      * @type {IStorage <ICustomNode>}
      */
     @initializable()
-    private controlFlowStorage: IStorage <ICustomNode>;
+    private controlFlowStorage!: IStorage <ICustomNode>;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -21,25 +21,25 @@ export class ExpressionWithOperatorControlFlowStorageCallNode extends AbstractCu
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageKey: string;
+    private controlFlowStorageKey!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageName: string;
+    private controlFlowStorageName!: string;
 
     /**
      * @type {Expression}
      */
     @initializable()
-    private leftValue: Expression;
+    private leftValue!: Expression;
 
     /**
      * @type {ESTree.Expression}
      */
     @initializable()
-    private rightValue: Expression;
+    private rightValue!: Expression;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -19,13 +19,13 @@ export class StringLiteralControlFlowStorageCallNode extends AbstractCustomNode
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageKey: string;
+    private controlFlowStorageKey!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private controlFlowStorageName: string;
+    private controlFlowStorageName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -21,13 +21,13 @@ export class BlockStatementDeadCodeInjectionNode extends AbstractCustomNode {
      * @type {BlockStatement}
      */
     @initializable()
-    private blockStatementNode: BlockStatement;
+    private blockStatementNode!: BlockStatement;
 
     /**
      * @type {BlockStatement}
      */
     @initializable()
-    private deadCodeInjectionRootAstHostNode: BlockStatement;
+    private deadCodeInjectionRootAstHostNode!: BlockStatement;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -22,13 +22,13 @@ export class DebugProtectionFunctionCallNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private callsControllerFunctionName: string;
+    private callsControllerFunctionName!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private debugProtectionFunctionName: string;
+    private debugProtectionFunctionName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -22,7 +22,7 @@ export class DebugProtectionFunctionIntervalNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private debugProtectionFunctionName: string;
+    private debugProtectionFunctionName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -26,7 +26,7 @@ export class DebugProtectionFunctionNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private debugProtectionFunctionName: string;
+    private debugProtectionFunctionName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -29,7 +29,7 @@ export class DebugProtectionCustomNodeGroup extends AbstractCustomNodeGroup {
      * @type {Map<CustomNode, ICustomNode>}
      */
     @initializable()
-    protected customNodes: Map <CustomNode, ICustomNode>;
+    protected customNodes!: Map <CustomNode, ICustomNode>;
 
     /**
      * @type {TCustomNodeFactory}

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

@@ -26,7 +26,7 @@ export class DomainLockNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    protected callsControllerFunctionName: string;
+    protected callsControllerFunctionName!: string;
 
     /**
      * @type {ICryptUtils}

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

@@ -29,7 +29,7 @@ export class DomainLockCustomNodeGroup extends AbstractCustomNodeGroup {
      * @type {Map<CustomNode, ICustomNode>}
      */
     @initializable()
-    protected customNodes: Map <CustomNode, ICustomNode>;
+    protected customNodes!: Map <CustomNode, ICustomNode>;
 
     /**
      * @type {TCustomNodeFactory}

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

@@ -27,13 +27,13 @@ export class NodeCallsControllerFunctionNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    protected callsControllerFunctionName: string;
+    protected callsControllerFunctionName!: string;
 
     /**
      * @type {ObfuscationEvent}
      */
     @initializable()
-    private appendEvent: ObfuscationEvent;
+    private appendEvent!: ObfuscationEvent;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -31,7 +31,7 @@ export class SelfDefendingUnicodeNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private callsControllerFunctionName: string;
+    private callsControllerFunctionName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -29,7 +29,7 @@ export class SelfDefendingCustomNodeGroup extends AbstractCustomNodeGroup {
      * @type {Map<CustomNode, ICustomNode>}
      */
     @initializable()
-    protected customNodes: Map <CustomNode, ICustomNode>;
+    protected customNodes!: Map <CustomNode, ICustomNode>;
 
     /**
      * @type {TCustomNodeFactory}

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

@@ -40,13 +40,13 @@ export class StringArrayCallsWrapper extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private stringArrayName: string;
+    private stringArrayName!: string;
 
     /**
      * @type {string}
      */
     @initializable()
-    private stringArrayCallsWrapperName: string;
+    private stringArrayCallsWrapperName!: string;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -24,19 +24,19 @@ export class StringArrayNode extends AbstractCustomNode {
      * @type {IStorage <string>}
      */
     @initializable()
-    private stringArrayStorage: IStorage <string>;
+    private stringArrayStorage!: IStorage <string>;
 
     /**
      * @type {string}
      */
     @initializable()
-    private stringArrayName: string;
+    private stringArrayName!: string;
 
     /**
      * @type {number}
      */
     @initializable()
-    private stringArrayRotateValue: number;
+    private stringArrayRotateValue!: number;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -33,13 +33,13 @@ export class StringArrayRotateFunctionNode extends AbstractCustomNode {
      * @type {string}
      */
     @initializable()
-    private stringArrayName: string;
+    private stringArrayName!: string;
 
     /**
      * @param {number}
      */
     @initializable()
-    private stringArrayRotateValue: number;
+    private stringArrayRotateValue!: number;
 
     /**
      * @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory

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

@@ -30,7 +30,7 @@ export class StringArrayCustomNodeGroup extends AbstractCustomNodeGroup {
      * @type {Map<CustomNode, ICustomNode>}
      */
     @initializable()
-    protected customNodes: Map <CustomNode, ICustomNode>;
+    protected customNodes!: Map <CustomNode, ICustomNode>;
 
     /**
      * @type {TCustomNodeFactory}
@@ -40,7 +40,6 @@ export class StringArrayCustomNodeGroup extends AbstractCustomNodeGroup {
     /**
      * @type {IStorage <string>}
      */
-    @initializable()
     private stringArrayStorage: IStorage <string>;
 
     /**

+ 3 - 3
src/logger/Logger.ts

@@ -22,19 +22,19 @@ export class Logger implements ILogger, IInitializable {
      * @type {Chalk}
      */
     @initializable()
-    private colorInfo: Chalk;
+    private colorInfo!: Chalk;
 
     /**
      * @type {Chalk}
      */
     @initializable()
-    private colorSuccess: Chalk;
+    private colorSuccess!: Chalk;
 
     /**
      * @type {Chalk}
      */
     @initializable()
-    private colorWarn: Chalk;
+    private colorWarn!: Chalk;
 
     /**
      * @type {IOptions}

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

@@ -20,7 +20,7 @@ export abstract class AbstractNodeTransformer implements INodeTransformer, IInit
      * @type {number}
      */
     @initializable()
-    protected nodeIdentifier: number;
+    protected nodeIdentifier!: number;
 
     /**
      * @type {IOptions}

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

@@ -17,16 +17,6 @@ import { NodeGuards } from '../../../node/NodeGuards';
 
 @injectable()
 export abstract class ExpressionWithOperatorControlFlowReplacer extends AbstractControlFlowReplacer {
-    /**
-     * @type {IOptions}
-     */
-    protected readonly options: IOptions;
-
-    /**
-     * @type {Map<string, Map<string, string[]>>}
-     */
-    protected readonly replacerDataByControlFlowStorageId: Map <string, Map<string, string[]>> = new Map();
-
     /**
      * @param {TControlFlowCustomNodeFactory} controlFlowCustomNodeFactory
      * @param {IRandomGenerator} randomGenerator

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

@@ -65,7 +65,7 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
     /**
      * @type {number}
      */
-    private collectedBlockStatementsTotalLength: number;
+    private collectedBlockStatementsTotalLength: number = 0;
 
     /**
      * @type {TDeadNodeInjectionCustomNodeFactory}

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

@@ -41,7 +41,7 @@ export class CustomNodesTransformer extends AbstractNodeTransformer {
     /**
      * @type {IStackTraceData[]}
      */
-    private stackTraceData: IStackTraceData[];
+    private stackTraceData: IStackTraceData[] = [];
 
     /**
      * @param {IStackTraceAnalyzer} stackTraceAnalyzer

+ 27 - 27
src/options/Options.ts

@@ -47,13 +47,13 @@ export class Options implements IOptions {
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly compact: boolean;
+    public readonly compact!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly controlFlowFlattening: boolean;
+    public readonly controlFlowFlattening!: boolean;
 
     /**
      * @type {boolean}
@@ -61,37 +61,37 @@ export class Options implements IOptions {
     @IsNumber()
     @Min(0)
     @Max(1)
-    public readonly controlFlowFlatteningThreshold: number;
+    public readonly controlFlowFlatteningThreshold!: number;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly deadCodeInjection: boolean;
+    public readonly deadCodeInjection!: boolean;
 
     /**
      * @type {number}
      */
     @IsNumber()
-    public readonly deadCodeInjectionThreshold: number;
+    public readonly deadCodeInjectionThreshold!: number;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly debugProtection: boolean;
+    public readonly debugProtection!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly debugProtectionInterval: boolean;
+    public readonly debugProtectionInterval!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly disableConsoleOutput: boolean;
+    public readonly disableConsoleOutput!: boolean;
 
     /**
      * @type {string[]}
@@ -101,7 +101,7 @@ export class Options implements IOptions {
     @IsString({
         each: true
     })
-    public readonly domainLock: string[];
+    public readonly domainLock!: string[];
 
     /**
      * @type {IdentifierNamesGenerator}
@@ -110,25 +110,25 @@ export class Options implements IOptions {
         IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
         IdentifierNamesGenerator.MangledIdentifierNamesGenerator
     ])
-    public readonly identifierNamesGenerator: IdentifierNamesGenerator;
+    public readonly identifierNamesGenerator!: IdentifierNamesGenerator;
 
     /**
      * @type {string}
      */
     @IsString()
-    public readonly identifiersPrefix: string;
+    public readonly identifiersPrefix!: string;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly log: boolean;
+    public readonly log!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly renameGlobals: boolean;
+    public readonly renameGlobals!: boolean;
 
     /**
      * @type {string[]}
@@ -138,31 +138,31 @@ export class Options implements IOptions {
     @IsString({
         each: true
     })
-    public readonly reservedNames: string[];
+    public readonly reservedNames!: string[];
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly rotateStringArray: boolean;
+    public readonly rotateStringArray!: boolean;
 
     /**
      * @type {number}
      */
     @IsNumber()
-    public readonly seed: number;
+    public readonly seed!: number;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly selfDefending: boolean;
+    public readonly selfDefending!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly sourceMap: boolean;
+    public readonly sourceMap!: boolean;
 
     /**
      * @type {string}
@@ -174,31 +174,31 @@ export class Options implements IOptions {
         require_tld: false,
         require_valid_protocol: true
     })
-    public readonly sourceMapBaseUrl: string;
+    public readonly sourceMapBaseUrl!: string;
 
     /**
      * @type {string}
      */
     @IsString()
-    public readonly sourceMapFileName: string;
+    public readonly sourceMapFileName!: string;
 
     /**
      * @type {SourceMapMode}
      */
     @IsIn([SourceMapMode.Inline, SourceMapMode.Separate])
-    public readonly sourceMapMode: SourceMapMode;
+    public readonly sourceMapMode!: SourceMapMode;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly stringArray: boolean;
+    public readonly stringArray!: boolean;
 
     /**
      * @type {TStringArrayEncoding}
      */
     @IsIn([true, false, StringArrayEncoding.Base64, StringArrayEncoding.Rc4])
-    public readonly stringArrayEncoding: TStringArrayEncoding;
+    public readonly stringArrayEncoding!: TStringArrayEncoding;
 
     /**
      * @type {number}
@@ -206,25 +206,25 @@ export class Options implements IOptions {
     @IsNumber()
     @Min(0)
     @Max(1)
-    public readonly stringArrayThreshold: number;
+    public readonly stringArrayThreshold!: number;
 
     /**
      * @type {ObfuscationTarget}
      */
     @IsIn([ObfuscationTarget.Browser, ObfuscationTarget.Extension, ObfuscationTarget.Node])
-    public readonly target: ObfuscationTarget;
+    public readonly target!: ObfuscationTarget;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly transformObjectKeys: boolean;
+    public readonly transformObjectKeys!: boolean;
 
     /**
      * @type {boolean}
      */
     @IsBoolean()
-    public readonly unicodeEscapeSequence: boolean;
+    public readonly unicodeEscapeSequence!: boolean;
 
     /**
      * @param {TInputOptions} inputOptions

+ 2 - 2
src/storages/ArrayStorage.ts

@@ -23,13 +23,13 @@ export abstract class ArrayStorage <T> implements IStorage <T> {
      * @type {T[]}
      */
     @initializable()
-    protected storage: T[];
+    protected storage!: T[];
 
     /**
      * @type {string}
      */
     @initializable()
-    protected storageId: string;
+    protected storageId!: string;
 
     /**
      * @type {number}

+ 2 - 2
src/storages/MapStorage.ts

@@ -23,13 +23,13 @@ export abstract class MapStorage <T> implements IStorage <T> {
      * @type {string}
      */
     @initializable()
-    protected storageId: string;
+    protected storageId!: string;
 
     /**
      * @type {Map <string | number, T>}
      */
     @initializable()
-    protected storage: Map <string | number, T>;
+    protected storage!: Map <string | number, T>;
 
     /**
      * @param {IRandomGenerator} randomGenerator

+ 2 - 2
src/utils/RandomGenerator.ts

@@ -27,13 +27,13 @@ export class RandomGenerator implements IRandomGenerator, IInitializable {
      * @type {Chance.Chance | Chance.SeededChance}
      */
     @initializable()
-    private randomGenerator: Chance.Chance | Chance.SeededChance;
+    private randomGenerator!: Chance.Chance | Chance.SeededChance;
 
     /**
      * @type {number}
      */
     @initializable()
-    private seed: number;
+    private seed!: number;
 
     /**
      * @type {ISourceCode}

+ 4 - 4
test/unit-tests/decorators/initializable/Initializable.spec.ts

@@ -9,7 +9,7 @@ describe('@initializable', () => {
             const testFunc: () => void = () => {
                 class Foo implements IInitializable {
                     @initializable()
-                    public property: string;
+                    public property!: string;
 
                     public initialize (property: string): void {
                         this.property = property;
@@ -32,7 +32,7 @@ describe('@initializable', () => {
             const testFunc: () => void = () => {
                 class Foo implements IInitializable {
                     @initializable()
-                    public property: string;
+                    public property!: string;
 
                     public initialize (): void {
                     }
@@ -58,7 +58,7 @@ describe('@initializable', () => {
             const testFunc: () => void = () => {
                 class Foo implements IInitializable {
                     @initializable()
-                    public property: string;
+                    public property!: string;
 
                     public initialize (property: string): void {
                     }
@@ -80,7 +80,7 @@ describe('@initializable', () => {
             const testFunc: () => void = () => {
                 class Foo {
                     @initializable('bar')
-                    public property: string;
+                    public property!: string;
 
                     public initialize (property: string): void {
                         this.property = property;

+ 0 - 1
tsconfig.json

@@ -15,7 +15,6 @@
     "removeComments": true,
     "sourceMap": true,
     "strict": true,
-    "strictPropertyInitialization": false,
     "target": "es2015",
     "plugins": [
       {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است