Selaa lähdekoodia

Remove few any types

sanex3339 7 vuotta sitten
vanhempi
commit
b061b3d889
30 muutettua tiedostoa jossa 76 lisäystä ja 66 poistoa
  1. 0 0
      dist/index.js
  2. 1 1
      src/analyzers/stack-trace-analyzer/StackTraceAnalyzer.ts
  3. 1 1
      src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts
  4. 1 1
      src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts
  5. 1 1
      src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts
  6. 1 2
      src/cli/JavaScriptObfuscatorCLI.ts
  7. 1 1
      src/cli/sanitizers/ArraySanitizer.ts
  8. 1 1
      src/cli/sanitizers/BooleanSanitizer.ts
  9. 1 1
      src/cli/sanitizers/IdentifierNamesGeneratorSanitizer.ts
  10. 1 1
      src/cli/sanitizers/ObfuscatingTargetSanitizer.ts
  11. 1 1
      src/cli/sanitizers/SourceMapModeSanitizer.ts
  12. 1 1
      src/cli/sanitizers/StringArrayEncodingSanitizer.ts
  13. 8 5
      src/container/InversifyContainerFacade.ts
  14. 3 2
      src/declarations/ESTree.d.ts
  15. 5 0
      src/declarations/escodegen.d.ts
  16. 2 2
      src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/IObfuscatingReplacer.d.ts
  17. 1 1
      src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts
  18. 1 1
      src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts
  19. 2 2
      src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts
  20. 1 1
      src/node-transformers/obfuscating-transformers/CatchClauseTransformer.ts
  21. 1 1
      src/node-transformers/obfuscating-transformers/ClassDeclarationTransformer.ts
  22. 1 1
      src/node-transformers/obfuscating-transformers/FunctionDeclarationTransformer.ts
  23. 2 2
      src/node-transformers/obfuscating-transformers/FunctionTransformer.ts
  24. 1 1
      src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts
  25. 1 1
      src/node-transformers/obfuscating-transformers/VariableDeclarationTransformer.ts
  26. 2 2
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts
  27. 17 19
      src/node/NodeUtils.ts
  28. 2 2
      src/node/Nodes.ts
  29. 1 1
      src/types/cli/TCLISanitizer.d.ts
  30. 14 10
      test/unit-tests/cli/sanitizers/StringArrayEncodingSanitizer.spec.ts

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/index.js


+ 1 - 1
src/analyzers/stack-trace-analyzer/StackTraceAnalyzer.ts

@@ -126,7 +126,7 @@ export class StackTraceAnalyzer implements IStackTraceAnalyzer {
             const blockScopeBodyNode: ESTree.Node = blockScopeBody[index];
 
             estraverse.traverse(blockScopeBodyNode, {
-                enter: (node: ESTree.Node): any => {
+                enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                     if (!NodeGuards.isCallExpressionNode(node)) {
                         return;
                     }

+ 1 - 1
src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts

@@ -45,7 +45,7 @@ export class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataEx
         let calleeBlockStatement: ESTree.BlockStatement | null = null;
 
         estraverse.traverse(targetNode, {
-            enter: (node: ESTree.Node): any => {
+            enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                 if (NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) {
                     calleeBlockStatement = node.body;
 

+ 1 - 1
src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts

@@ -49,7 +49,7 @@ export class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExt
         let calleeBlockStatement: ESTree.BlockStatement | null = null;
 
         estraverse.traverse(targetNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): estraverse.VisitorOption | void => {
                 if (
                     NodeGuards.isFunctionExpressionNode(node) &&
                     parentNode &&

+ 1 - 1
src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts

@@ -101,7 +101,7 @@ export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtra
         let calleeBlockStatement: ESTree.BlockStatement | null = null;
 
         estraverse.traverse(targetNode, {
-            enter: (node: ESTree.Node): any => {
+            enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                 if (
                     NodeGuards.isVariableDeclaratorNode(node) &&
                     NodeGuards.isIdentifierNode(node.id) &&

+ 1 - 2
src/cli/JavaScriptObfuscatorCLI.ts

@@ -4,7 +4,6 @@ import * as path from 'path';
 
 import { TInputCLIOptions } from '../types/options/TInputCLIOptions';
 import { TInputOptions } from '../types/options/TInputOptions';
-import { TObject } from '../types/TObject';
 import { TSourceCodeData } from '../types/cli/TSourceCodeData';
 
 import { IFileData } from '../interfaces/cli/IFileData';
@@ -89,7 +88,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
      * @param {TObject} options
      * @returns {TInputOptions}
      */
-    private static filterOptions (options: TObject): TInputOptions {
+    private static filterOptions (options: TInputCLIOptions): TInputOptions {
         const filteredOptions: TInputOptions = {};
 
         for (const option in options) {

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

@@ -4,7 +4,7 @@ import { TCLISanitizer } from '../../types/cli/TCLISanitizer';
  * @param {string} value
  * @returns {string[]}
  */
-export const ArraySanitizer: TCLISanitizer = (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'`);
     }

+ 1 - 1
src/cli/sanitizers/BooleanSanitizer.ts

@@ -4,6 +4,6 @@ import { TCLISanitizer } from '../../types/cli/TCLISanitizer';
  * @param {string} value
  * @returns {boolean}
  */
-export const BooleanSanitizer: TCLISanitizer = (value: string): boolean => {
+export const BooleanSanitizer: TCLISanitizer <boolean> = (value: string): boolean => {
     return value === 'true' || value === '1';
 };

+ 1 - 1
src/cli/sanitizers/IdentifierNamesGeneratorSanitizer.ts

@@ -6,7 +6,7 @@ import { IdentifierNamesGenerator } from '../../enums/generators/identifier-name
  * @param {string} value
  * @returns {string}
  */
-export const IdentifierNamesGeneratorSanitizer: TCLISanitizer = (value: string): string => {
+export const IdentifierNamesGeneratorSanitizer: TCLISanitizer <string> = (value: string): string => {
     const isCorrectIdentifierNamesGenerator: boolean = Object
         .keys(IdentifierNamesGenerator)
         .some((key: any): boolean => {

+ 1 - 1
src/cli/sanitizers/ObfuscatingTargetSanitizer.ts

@@ -6,7 +6,7 @@ import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
  * @param {string} value
  * @returns {string}
  */
-export const ObfuscationTargetSanitizer: TCLISanitizer = (value: string): string => {
+export const ObfuscationTargetSanitizer: TCLISanitizer <string> = (value: string): string => {
     const isCorrectTarget: boolean = Object
         .keys(ObfuscationTarget)
         .some((key: any): boolean => {

+ 1 - 1
src/cli/sanitizers/SourceMapModeSanitizer.ts

@@ -6,7 +6,7 @@ import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
  * @param {string} value
  * @returns {string}
  */
-export const SourceMapModeSanitizer: TCLISanitizer = (value: string): string => {
+export const SourceMapModeSanitizer: TCLISanitizer <string> = (value: string): string => {
     const isCorrectSourceMapMode: boolean = Object
         .keys(SourceMapMode)
         .some((key: any): boolean => {

+ 1 - 1
src/cli/sanitizers/StringArrayEncodingSanitizer.ts

@@ -7,7 +7,7 @@ import { StringArrayEncoding } from '../../enums/StringArrayEncoding';
  * @param {string} value
  * @returns {TStringArrayEncoding}
  */
-export const StringArrayEncodingSanitizer: TCLISanitizer = (value: string): TStringArrayEncoding => {
+export const StringArrayEncodingSanitizer: TCLISanitizer <TStringArrayEncoding> = (value: string): TStringArrayEncoding => {
     switch (value) {
         case 'true':
         case '1':

+ 8 - 5
src/container/InversifyContainerFacade.ts

@@ -83,21 +83,24 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
 
     /**
      * @param {interfaces.ServiceIdentifier<interfaces.Newable<U>>} serviceIdentifier
-     * @param {any[]} dependencies
+     * @param {interfaces.ServiceIdentifier<interfaces.Newable<Object>>[]} dependencies
      * @returns {U}
      */
     public static getConstructorFactory <T extends string, U> (
         serviceIdentifier: interfaces.ServiceIdentifier<interfaces.Newable<U>>,
-        ...dependencies: any[]
+        ...dependencies: interfaces.ServiceIdentifier<interfaces.Newable<Object>>[]
     ): (context: interfaces.Context) => (bindingName: T) => U {
         return (context: interfaces.Context): (bindingName: T) => U => {
             const cache: Map<T, interfaces.Newable<U>> = new Map();
-            const cachedDependencies: any[] = [];
+            const cachedDependencies: Object[] = [];
 
             return (bindingName: T) => {
-                dependencies.forEach((dependency: any, index: number) => {
+                dependencies.forEach((
+                    dependency: interfaces.ServiceIdentifier<interfaces.Newable<Object>>,
+                    index: number
+                ) => {
                     if (!cachedDependencies[index]) {
-                        cachedDependencies[index] = context.container.get<any>(dependency);
+                        cachedDependencies[index] = context.container.get(dependency);
                     }
                 });
 

+ 3 - 2
src/declarations/ESTree.d.ts

@@ -1,5 +1,6 @@
 /* tslint:disable:interface-name */
 
+import * as escodegen from 'escodegen-wallaby';
 import * as ESTree from 'estree';
 
 declare module 'estree' {
@@ -14,10 +15,10 @@ declare module 'estree' {
     }
 
     interface SimpleLiteral extends ESTree.BaseNode, ESTree.BaseExpression {
-        'x-verbatim-property'?: any;
+        'x-verbatim-property'?: escodegen.XVerbatimProperty;
     }
 
     interface RegExpLiteral extends ESTree.BaseNode, ESTree.BaseExpression {
-        'x-verbatim-property'?: any;
+        'x-verbatim-property'?: escodegen.XVerbatimProperty;
     }
 }

+ 5 - 0
src/declarations/escodegen.d.ts

@@ -4,6 +4,11 @@ import * as ESTree from 'estree';
 import { IGeneratorOutput } from '../interfaces/IGeneratorOutput';
 
 declare module 'escodegen' {
+    export type XVerbatimProperty = {
+        content?: string;
+        precedence: escodegen.Precedence;
+    };
+
     /**
      * @param ast
      * @param options

+ 2 - 2
src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/IObfuscatingReplacer.d.ts

@@ -2,9 +2,9 @@ import * as ESTree from 'estree';
 
 export interface IObfuscatingReplacer <T = ESTree.Node> {
     /**
-     * @param nodeValue
+     * @param {SimpleLiteral['value']} nodeValue
      * @param {number} nodeIdentifier
      * @returns {T}
      */
-    replace (nodeValue: any, nodeIdentifier?: number): T;
+    replace (nodeValue: ESTree.SimpleLiteral['value'], nodeIdentifier?: number): T;
 }

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

@@ -78,7 +78,7 @@ export class BlockStatementControlFlowTransformer extends AbstractNodeTransforme
         let canTransform: boolean = true;
 
         estraverse.traverse(blockStatementNode, {
-            enter: (node: ESTree.Node): any => {
+            enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                 if (NodeGuards.isWhileStatementNode(node)) {
                     return estraverse.VisitorOption.Skip;
                 }

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

@@ -222,7 +222,7 @@ export class FunctionControlFlowTransformer extends AbstractNodeTransformer {
      */
     private transformFunctionBody (functionNodeBody: ESTree.BlockStatement, controlFlowStorage: IStorage<ICustomNode>): void {
         estraverse.replace(functionNodeBody, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): estraverse.VisitorOption | ESTree.Node => {
                 if (node.ignoredNode) {
                     return estraverse.VisitorOption.Skip;
                 }

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

@@ -111,7 +111,7 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
             isValidBlockStatementNode: boolean = true;
 
         estraverse.traverse(blockStatementNode, {
-            enter: (node: ESTree.Node): any => {
+            enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                 if (NodeGuards.isBlockStatementNode(node)) {
                     nestedBlockStatementsCount++;
                 }
@@ -176,7 +176,7 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
      */
     public analyzeNode (programNode: ESTree.Node, parentNode: ESTree.Node): void {
         estraverse.traverse(programNode, {
-            enter: (node: ESTree.Node): any => {
+            enter: (node: ESTree.Node): void => {
                 if (!NodeGuards.isBlockStatementNode(node)) {
                     return;
                 }

+ 1 - 1
src/node-transformers/obfuscating-transformers/CatchClauseTransformer.ts

@@ -100,7 +100,7 @@ export class CatchClauseTransformer extends AbstractNodeTransformer {
      */
     private replaceCatchClauseParam (catchClauseNode: ESTree.CatchClause, nodeIdentifier: number): void {
         estraverse.replace(catchClauseNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (parentNode && NodeGuards.isReplaceableIdentifierNode(node, parentNode)) {
                     const newIdentifier: ESTree.Identifier = this.identifierObfuscatingReplacer
                         .replace(node.name, nodeIdentifier);

+ 1 - 1
src/node-transformers/obfuscating-transformers/ClassDeclarationTransformer.ts

@@ -145,7 +145,7 @@ export class ClassDeclarationTransformer extends AbstractNodeTransformer {
         const storedReplaceableIdentifiers: ESTree.Identifier[] = [];
 
         estraverse.replace(blockScopeNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (parentNode && NodeGuards.isReplaceableIdentifierNode(node, parentNode)) {
                     const newIdentifier: ESTree.Identifier = this.identifierObfuscatingReplacer
                         .replace(node.name, nodeIdentifier);

+ 1 - 1
src/node-transformers/obfuscating-transformers/FunctionDeclarationTransformer.ts

@@ -166,7 +166,7 @@ export class FunctionDeclarationTransformer extends AbstractNodeTransformer {
         const storedReplaceableIdentifiersNamesMap: TReplaceableIdentifiersNames = new Map();
 
         estraverse.replace(blockScopeNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (parentNode && NodeGuards.isReplaceableIdentifierNode(node, parentNode)) {
                     const newIdentifier: ESTree.Identifier = this.identifierObfuscatingReplacer
                         .replace(node.name, nodeIdentifier);

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

@@ -102,7 +102,7 @@ export class FunctionTransformer extends AbstractNodeTransformer {
                 }
 
                 estraverse.traverse(paramsNode, {
-                    enter: (node: ESTree.Node): any => {
+                    enter: (node: ESTree.Node): estraverse.VisitorOption | void => {
                         if (NodeGuards.isAssignmentPatternNode(node) && NodeGuards.isIdentifierNode(node.left)) {
                             this.identifierObfuscatingReplacer.storeLocalName(node.left.name, nodeIdentifier);
 
@@ -142,7 +142,7 @@ export class FunctionTransformer extends AbstractNodeTransformer {
         const ignoredIdentifierNamesSet: Set<string> = new Set();
 
         const replaceVisitor: estraverse.Visitor = {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (NodeGuards.isObjectPatternNode(node)) {
                     this.addIdentifiersToIgnoredIdentifierNamesSet(node.properties, ignoredIdentifierNamesSet);
                 }

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

@@ -106,7 +106,7 @@ export class LabeledStatementTransformer extends AbstractNodeTransformer {
      */
     private replaceLabeledStatementName (labeledStatementNode: ESTree.LabeledStatement, nodeIdentifier: number): void {
         estraverse.replace(labeledStatementNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (parentNode && NodeGuards.isLabelIdentifierNode(node, parentNode)) {
                     const newIdentifier: ESTree.Identifier = this.identifierObfuscatingReplacer
                         .replace(node.name, nodeIdentifier);

+ 1 - 1
src/node-transformers/obfuscating-transformers/VariableDeclarationTransformer.ts

@@ -185,7 +185,7 @@ export class VariableDeclarationTransformer extends AbstractNodeTransformer {
         const storedReplaceableIdentifiersNamesMap: TReplaceableIdentifiersNames = new Map();
 
         estraverse.replace(blockScopeNode, {
-            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): any => {
+            enter: (node: ESTree.Node, parentNode: ESTree.Node | null): void => {
                 if (parentNode && !node.obfuscatedNode && NodeGuards.isReplaceableIdentifierNode(node, parentNode)) {
                     const newIdentifier: ESTree.Identifier = this.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier);
                     const newIdentifierName: string = newIdentifier.name;

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

@@ -23,9 +23,9 @@ export abstract class AbstractObfuscatingReplacer implements IObfuscatingReplace
     }
 
     /**
-     * @param {any} nodeValue
+     * @param {SimpleLiteral['value']} nodeValue
      * @param {number} nodeIdentifier
      * @returns {Node}
      */
-    public abstract replace (nodeValue: any, nodeIdentifier?: number): ESTree.Node;
+    public abstract replace (nodeValue: ESTree.SimpleLiteral['value'], nodeIdentifier?: number): ESTree.Node;
 }

+ 17 - 19
src/node/NodeUtils.ts

@@ -136,29 +136,27 @@ export class NodeUtils {
 
         const copy: TObject = {};
 
-        Object
-            .keys(node)
-            .forEach((property: string): void => {
-                if (property === 'parentNode') {
-                    return;
-                }
+        for (const property in node) {
+            if (!node.hasOwnProperty(property) || property === 'parentNode') {
+                continue;
+            }
 
-                const value: any = (<TObject>node)[property];
+            const value: any = node[property];
 
-                let clonedValue: any | null;
+            let clonedValue: any | null;
 
-                if (value === null || value instanceof RegExp) {
-                    clonedValue = value;
-                } else if (Array.isArray(value)) {
-                    clonedValue = value.map(NodeUtils.cloneRecursive);
-                } else if (typeof value === 'object') {
-                    clonedValue = NodeUtils.cloneRecursive(value);
-                } else {
-                    clonedValue = value;
-                }
+            if (value === null || value instanceof RegExp) {
+                clonedValue = value;
+            } else if (Array.isArray(value)) {
+                clonedValue = value.map(NodeUtils.cloneRecursive);
+            } else if (typeof value === 'object') {
+                clonedValue = NodeUtils.cloneRecursive(value);
+            } else {
+                clonedValue = value;
+            }
 
-                copy[property] = clonedValue;
-            });
+            copy[property] = clonedValue;
+        }
 
         return <T>copy;
     }

+ 2 - 2
src/node/Nodes.ts

@@ -434,10 +434,10 @@ export class Nodes {
 
     /**
      * @param {Identifier} id
-     * @param {any} init
+     * @param {Expression | null} init
      * @returns {VariableDeclarator}
      */
-    public static getVariableDeclaratorNode (id: ESTree.Identifier, init: any): ESTree.VariableDeclarator {
+    public static getVariableDeclaratorNode (id: ESTree.Identifier, init: ESTree.Expression | null): ESTree.VariableDeclarator {
         return {
             type: NodeType.VariableDeclarator,
             id,

+ 1 - 1
src/types/cli/TCLISanitizer.d.ts

@@ -1 +1 @@
-export type TCLISanitizer = (value: string) => any;
+export type TCLISanitizer <T> = (value: string) => T;

+ 14 - 10
test/unit-tests/cli/sanitizers/StringArrayEncodingSanitizer.spec.ts

@@ -1,14 +1,18 @@
 import { assert } from 'chai';
 
+import { TStringArrayEncoding } from '../../../../src/types/options/TStringArrayEncoding';
+
+import { StringArrayEncoding } from '../../../../src/enums/StringArrayEncoding';
+
 import { StringArrayEncodingSanitizer } from '../../../../src/cli/sanitizers/StringArrayEncodingSanitizer';
 
 describe('StringArrayEncodingSanitizer', () => {
     describe('StringArrayEncodingSanitizer: TCLISanitizer = (value: string): TStringArrayEncoding', () => {
         describe('variant #1: string array encoding `base64`', () => {
             const inputValue: string = 'base64';
-            const expectedValue: boolean = true;
+            const expectedValue: TStringArrayEncoding = true;
 
-            let value: boolean;
+            let value: TStringArrayEncoding;
 
             before(() => {
                 value = StringArrayEncodingSanitizer(inputValue);
@@ -21,9 +25,9 @@ describe('StringArrayEncodingSanitizer', () => {
 
         describe('variant #2: string array encoding `true`', () => {
             const inputValue: string = 'true';
-            const expectedValue: boolean = true;
+            const expectedValue: TStringArrayEncoding = true;
 
-            let value: boolean;
+            let value: TStringArrayEncoding;
 
             before(() => {
                 value = StringArrayEncodingSanitizer(inputValue);
@@ -36,9 +40,9 @@ describe('StringArrayEncodingSanitizer', () => {
 
         describe('variant #3: string array encoding `1`', () => {
             const inputValue: string = '1';
-            const expectedValue: boolean = true;
+            const expectedValue: TStringArrayEncoding = true;
 
-            let value: boolean;
+            let value: TStringArrayEncoding;
 
             before(() => {
                 value = StringArrayEncodingSanitizer(inputValue);
@@ -51,9 +55,9 @@ describe('StringArrayEncodingSanitizer', () => {
 
         describe('variant #4: string array encoding `rc4`', () => {
             const inputValue: string = 'rc4';
-            const expectedValue: string = 'rc4';
+            const expectedValue: TStringArrayEncoding = StringArrayEncoding.Rc4;
 
-            let value: string;
+            let value: TStringArrayEncoding;
 
             before(() => {
                 value = StringArrayEncodingSanitizer(inputValue);
@@ -66,9 +70,9 @@ describe('StringArrayEncodingSanitizer', () => {
 
         describe('variant #5: string array encoding `foo`', () => {
             const inputValue: string = 'foo';
-            const expectedValue: boolean = false;
+            const expectedValue: TStringArrayEncoding = false;
 
-            let value: boolean;
+            let value: TStringArrayEncoding;
 
             before(() => {
                 value = StringArrayEncodingSanitizer(inputValue);

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä