javascript-obfuscator
Version:
JavaScript obfuscator
58 lines (46 loc) • 2.31 kB
text/typescript
import { inject, injectable, postConstruct } from 'inversify';
import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
import { TCustomCodeHelperGroupFactory } from '../../types/container/custom-code-helpers/TCustomCodeHelperGroupFactory';
import { ICustomCodeHelperGroup } from '../../interfaces/custom-code-helpers/ICustomCodeHelperGroup';
import { IOptions } from '../../interfaces/options/IOptions';
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
import { CustomCodeHelperGroup } from '../../enums/custom-code-helpers/CustomCodeHelperGroup';
import { MapStorage } from '../MapStorage';
()
export class CustomCodeHelperGroupStorage extends MapStorage <string, ICustomCodeHelperGroup> {
/**
* @type {CustomCodeHelperGroup[]}
*/
private static readonly customCodeHelperGroupsList: CustomCodeHelperGroup[] = [
CustomCodeHelperGroup.ConsoleOutput,
CustomCodeHelperGroup.DebugProtection,
CustomCodeHelperGroup.DomainLock,
CustomCodeHelperGroup.SelfDefending,
CustomCodeHelperGroup.StringArray
];
/**
* @type {TCustomNodesFactoriesFactory}
*/
private readonly customCodeHelperGroupFactory: TCustomCodeHelperGroupFactory;
/**
* @param {TCustomCodeHelperGroupFactory} customCodeHelperGroupFactory
* @param {IRandomGenerator} randomGenerator
* @param {IOptions} options
*/
public constructor (
(ServiceIdentifiers.Factory__ICustomCodeHelperGroup) customCodeHelperGroupFactory: TCustomCodeHelperGroupFactory,
(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
(ServiceIdentifiers.IOptions) options: IOptions
) {
super(randomGenerator, options);
this.customCodeHelperGroupFactory = customCodeHelperGroupFactory;
}
()
public initialize (): void {
super.initialize();
CustomCodeHelperGroupStorage.customCodeHelperGroupsList.forEach((customCodeHelperGroupName: CustomCodeHelperGroup) => {
const customCodeHelperGroup: ICustomCodeHelperGroup = this.customCodeHelperGroupFactory(customCodeHelperGroupName);
this.storage.set(customCodeHelperGroupName, customCodeHelperGroup);
});
}
}