# All files / src/container/modules/custom-nodes CustomNodesModule.ts

100% Statements 47/47
100% Branches 0/0
100% Functions 5/5
100% Lines 47/47

    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    1271x
    1x

    1x
    1x

    1x
    1x
    1x
    1x
    1x

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

    1x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    1819x

    9465x
    3679x

    1819x

    1812x
    9060x

     import { ContainerModule, interfaces } from 'inversify';
    import { ServiceIdentifiers } from '../../ServiceIdentifiers';

    import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode';
    import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup';

    import { CustomNodes } from '../../../enums/container/CustomNodes';
    import { CustomNodeGroups } from '../../../enums/container/CustomNodeGroups';

    import { ConsoleOutputCustomNodeGroup } from '../../../custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup';
    import { DebugProtectionCustomNodeGroup } from '../../../custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup';
    import { DomainLockCustomNodeGroup } from '../../../custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup';
    import { SelfDefendingCustomNodeGroup } from '../../../custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup';
    import { StringArrayCustomNodeGroup } from '../../../custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup';

    import { BinaryExpressionFunctionNode } from '../../../custom-nodes/control-flow-replacers-nodes/binary-expression-control-flow-replacer-nodes/BinaryExpressionFunctionNode';
    import { ControlFlowStorageCallNode } from '../../../custom-nodes/control-flow-replacers-nodes/binary-expression-control-flow-replacer-nodes/ControlFlowStorageCallNode';
    import { ControlFlowStorageNode } from '../../../custom-nodes/control-flow-storage-nodes/ControlFlowStorageNode';
    import { ConsoleOutputDisableExpressionNode } from '../../../custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode';
    import { DebugProtectionFunctionCallNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode';
    import { DebugProtectionFunctionIntervalNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode';
    import { DebugProtectionFunctionNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode';
    import { DomainLockNode } from '../../../custom-nodes/domain-lock-nodes/DomainLockNode';
    import { NodeCallsControllerFunctionNode } from '../../../custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode';
    import { SelfDefendingUnicodeNode } from '../../../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode';
    import { StringArrayCallsWrapper } from '../../../custom-nodes/string-array-nodes/StringArrayCallsWrapper';
    import { StringArrayNode } from '../../../custom-nodes/string-array-nodes/StringArrayNode';
    import { StringArrayRotateFunctionNode } from '../../../custom-nodes/string-array-nodes/StringArrayRotateFunctionNode';

    export const customNodesModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
        // custom nodes
        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(BinaryExpressionFunctionNode)
            .whenTargetNamed(CustomNodes.BinaryExpressionFunctionNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(ControlFlowStorageCallNode)
            .whenTargetNamed(CustomNodes.ControlFlowStorageCallNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(ControlFlowStorageNode)
            .whenTargetNamed(CustomNodes.ControlFlowStorageNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(ConsoleOutputDisableExpressionNode)
            .whenTargetNamed(CustomNodes.ConsoleOutputDisableExpressionNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(DebugProtectionFunctionCallNode)
            .whenTargetNamed(CustomNodes.DebugProtectionFunctionCallNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(DebugProtectionFunctionIntervalNode)
            .whenTargetNamed(CustomNodes.DebugProtectionFunctionIntervalNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(DebugProtectionFunctionNode)
            .whenTargetNamed(CustomNodes.DebugProtectionFunctionNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(DomainLockNode)
            .whenTargetNamed(CustomNodes.DomainLockNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(NodeCallsControllerFunctionNode)
            .whenTargetNamed(CustomNodes.NodeCallsControllerFunctionNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(SelfDefendingUnicodeNode)
            .whenTargetNamed(CustomNodes.SelfDefendingUnicodeNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(StringArrayCallsWrapper)
            .whenTargetNamed(CustomNodes.StringArrayCallsWrapper);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(StringArrayNode)
            .whenTargetNamed(CustomNodes.StringArrayNode);

        bind<ICustomNode>(ServiceIdentifiers.ICustomNode)
            .to(StringArrayRotateFunctionNode)
            .whenTargetNamed(CustomNodes.StringArrayRotateFunctionNode);

        // node groups
        bind<ICustomNodeGroup>(ServiceIdentifiers.ICustomNodeGroup)
            .to(ConsoleOutputCustomNodeGroup)
            .whenTargetNamed(CustomNodeGroups.ConsoleOutputCustomNodeGroup);

        bind<ICustomNodeGroup>(ServiceIdentifiers.ICustomNodeGroup)
            .to(DebugProtectionCustomNodeGroup)
            .whenTargetNamed(CustomNodeGroups.DebugProtectionCustomNodeGroup);

        bind<ICustomNodeGroup>(ServiceIdentifiers.ICustomNodeGroup)
            .to(DomainLockCustomNodeGroup)
            .whenTargetNamed(CustomNodeGroups.DomainLockCustomNodeGroup);

        bind<ICustomNodeGroup>(ServiceIdentifiers.ICustomNodeGroup)
            .to(SelfDefendingCustomNodeGroup)
            .whenTargetNamed(CustomNodeGroups.SelfDefendingCustomNodeGroup);

        bind<ICustomNodeGroup>(ServiceIdentifiers.ICustomNodeGroup)
            .to(StringArrayCustomNodeGroup)
            .whenTargetNamed(CustomNodeGroups.StringArrayCustomNodeGroup);

        // customNode factory
        bind<ICustomNode>(ServiceIdentifiers['Factory<ICustomNode>'])
            .toFactory<ICustomNode>((context: interfaces.Context) => {
                return (customNodeName: CustomNodes) => {
                    return context.container.getNamed<ICustomNode>(
                        ServiceIdentifiers.ICustomNode,
                        customNodeName
                    );
                };
            });

        // CustomNodeGroup factory
        bind<ICustomNodeGroup>(ServiceIdentifiers['Factory<ICustomNodeGroup>'])
            .toFactory<ICustomNodeGroup>((context: interfaces.Context) => {
                return (customNodeGroupName: CustomNodeGroups) => {
                    return context.container.getNamed<ICustomNodeGroup>(
                        ServiceIdentifiers.ICustomNodeGroup,
                        customNodeGroupName
                    );
                };
            });
    });