# All files / src/node-obfuscators/replacers AbstractReplacer.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

    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

    1x

    1x
    182465x
    182465x

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

    export abstract class AbstractReplacer implements IReplacer {
        /**
         * @type Map <string, AbstractCustomNode>
         */
        protected nodes: Map <string, ICustomNode>;

        /**
         * @type {IOptions}
         */
        protected options : IOptions;

        /**
         * @param nodes
         * @param options
         */
        constructor (nodes: Map <string, ICustomNode>, options: IOptions) {
            this.nodes = nodes;
            this.options = options;
        }

        /**
         * @param nodeValue
         * @param namesMap
         * @returns {string}
         */
        public abstract replace (nodeValue: any, namesMap?: Map <string, string>): string;
    }