Code coverage report for src/node-transformers/node-obfuscators/factory/NodeObfuscatorsFactory.ts

# All files / src/node-transformers/node-obfuscators/factory NodeObfuscatorsFactory.ts

85.71% Statements 12/14
100% Branches 0/0
0% Functions 0/1
92.31% Lines 12/13

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37

    1x

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x

     import { TNodeTransformer } from '../../../types/TNodeTransformer';

    import { NodeType } from '../../../enums/NodeType';

    import { CatchClauseObfuscator } from '../CatchClauseObfuscator';
    import { FunctionDeclarationObfuscator } from '../FunctionDeclarationObfuscator';
    import { FunctionObfuscator } from '../FunctionObfuscator';
    import { LabeledStatementObfuscator } from '../LabeledStatementObfuscator';
    import { LiteralObfuscator } from '../LiteralObfuscator';
    import { MemberExpressionObfuscator } from '../MemberExpressionObfuscator';
    import { MethodDefinitionObfuscator } from '../MethodDefinitionObfuscator';
    import { ObjectExpressionObfuscator } from '../ObjectExpressionObfuscator';
    import { VariableDeclarationObfuscator } from '../VariableDeclarationObfuscator';
    import { AbstractNodeTransformersFactory } from '../../AbstractNodeTransformersFactory';

    export class NodeObfuscatorsFactory extends AbstractNodeTransformersFactory {
        /**
         * @type {Map<string, TNodeTransformer[]>}
         */
        protected readonly nodeTransformers: Map <string, TNodeTransformer[]> = new Map <string, TNodeTransformer[]> ([
            [NodeType.ArrowFunctionExpression, [FunctionObfuscator]],
            [NodeType.ClassDeclaration, [FunctionDeclarationObfuscator]],
            [NodeType.CatchClause, [CatchClauseObfuscator]],
            [NodeType.FunctionDeclaration, [
                FunctionDeclarationObfuscator,
                FunctionObfuscator
            ]],
            [NodeType.FunctionExpression, [FunctionObfuscator]],
            [NodeType.MemberExpression, [MemberExpressionObfuscator]],
            [NodeType.MethodDefinition, [MethodDefinitionObfuscator]],
            [NodeType.ObjectExpression, [ObjectExpressionObfuscator]],
            [NodeType.VariableDeclaration, [VariableDeclarationObfuscator]],
            [NodeType.LabeledStatement, [LabeledStatementObfuscator]],
            [NodeType.Literal, [LiteralObfuscator]]
        ]);
    }