mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import { ICustomNode } from '../interfaces/ICustomNode';
|
|
import { IOptions } from "../interfaces/IOptions";
|
|
|
|
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 { NodesGroup } from './NodesGroup';
|
|
import { Utils } from '../Utils';
|
|
|
|
export class DebugProtectionNodesGroup extends NodesGroup {
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
private debugProtectionFunctionIdentifier: string = Utils.getRandomVariableName();
|
|
|
|
/**
|
|
* @param options
|
|
*/
|
|
constructor (options: IOptions = {}) {
|
|
super(options);
|
|
|
|
this.nodes = new Map <string, ICustomNode> ([
|
|
[
|
|
'debugProtectionFunctionNode',
|
|
new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier)
|
|
],
|
|
[
|
|
'debugProtectionFunctionCallNode',
|
|
new DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier)
|
|
]
|
|
]);
|
|
|
|
if (this.options['debugProtectionInterval']) {
|
|
this.nodes.set(
|
|
'debugProtectionFunctionIntervalNode',
|
|
new DebugProtectionFunctionIntervalNode(this.debugProtectionFunctionIdentifier)
|
|
);
|
|
}
|
|
}
|
|
}
|