mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Refactoring
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { IOptions } from "../interfaces/IOptions";
|
||||
|
||||
import { ConsoleOutputDisableExpressionNode } from "../custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode";
|
||||
import { NodesGroup } from './NodesGroup';
|
||||
|
||||
export class ConsoleOutputNodesGroup extends NodesGroup {
|
||||
/**
|
||||
* @param options
|
||||
*/
|
||||
constructor (options: IOptions) {
|
||||
super(options);
|
||||
|
||||
if (!this.options.get('disableConsoleOutput')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.nodes.set(
|
||||
'consoleOutputDisableExpressionNode',
|
||||
new ConsoleOutputDisableExpressionNode(this.options)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ export class DebugProtectionNodesGroup extends NodesGroup {
|
||||
constructor (options: IOptions) {
|
||||
super(options);
|
||||
|
||||
if (!this.options.get('debugProtection')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.nodes.set(
|
||||
'debugProtectionFunctionNode',
|
||||
new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier, this.options)
|
||||
|
||||
@@ -10,6 +10,10 @@ export class SelfDefendingNodesGroup extends NodesGroup {
|
||||
constructor (options: IOptions) {
|
||||
super(options);
|
||||
|
||||
if (!this.options.get('selfDefending')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.nodes.set(
|
||||
'selfDefendingUnicodeNode',
|
||||
new SelfDefendingUnicodeNode(this.options)
|
||||
|
||||
@@ -29,6 +29,10 @@ export class UnicodeArrayNodesGroup extends NodesGroup {
|
||||
constructor (options: IOptions) {
|
||||
super(options);
|
||||
|
||||
if (!this.options.get('unicodeArray')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.get('rotateUnicodeArray')) {
|
||||
this.unicodeArrayRotateValue = Utils.getRandomGenerator().integer({
|
||||
min: 100,
|
||||
|
||||
Reference in New Issue
Block a user