mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { injectable, inject } from 'inversify';
|
|
import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
|
|
|
|
import * as format from 'string-template';
|
|
|
|
import { IOptions } from '../../interfaces/options/IOptions';
|
|
|
|
import { initializable } from '../../decorators/Initializable';
|
|
|
|
import { DebugProtectionFunctionCallTemplate } from '../../templates/custom-nodes/debug-protection-nodes/debug-protection-function-call-node/DebufProtectionFunctionCallTemplate';
|
|
|
|
import { AbstractCustomNode } from '../AbstractCustomNode';
|
|
|
|
@injectable()
|
|
export class DebugProtectionFunctionCallNode extends AbstractCustomNode {
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
@initializable()
|
|
private debugProtectionFunctionName: string;
|
|
|
|
/**
|
|
* @param options
|
|
*/
|
|
constructor (
|
|
@inject(ServiceIdentifiers.IOptions) options: IOptions
|
|
) {
|
|
super(options);
|
|
}
|
|
|
|
/**
|
|
* @param debugProtectionFunctionName
|
|
*/
|
|
public initialize (debugProtectionFunctionName: string): void {
|
|
this.debugProtectionFunctionName = debugProtectionFunctionName;
|
|
}
|
|
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
public getCode (): string {
|
|
return format(DebugProtectionFunctionCallTemplate(), {
|
|
debugProtectionFunctionName: this.debugProtectionFunctionName
|
|
});
|
|
}
|
|
}
|