AbstractNodeObfuscator.ts 829 B

1234567891011121314151617181920212223242526272829303132
  1. import * as ESTree from 'estree';
  2. import { ICustomNode } from 'app/interfaces/custom-nodes/ICustomNode';
  3. import { INodeObfuscator } from 'app/interfaces/INodeObfuscator';
  4. import { IOptions } from 'app/interfaces/IOptions';
  5. export abstract class AbstractNodeObfuscator implements INodeObfuscator {
  6. /**
  7. * @type Map <string, AbstractCustomNode>
  8. */
  9. protected nodes: Map <string, ICustomNode>;
  10. /**
  11. * @type {IOptions}
  12. */
  13. protected options: IOptions;
  14. /**
  15. * @param nodes
  16. * @param options
  17. */
  18. constructor(nodes: Map <string, ICustomNode>, options: IOptions) {
  19. this.nodes = nodes;
  20. this.options = options;
  21. }
  22. /**
  23. * @param node
  24. * @param parentNode
  25. */
  26. public abstract obfuscateNode (node: ESTree.Node, parentNode?: ESTree.Node): void;
  27. }