sanex преди 3 години
родител
ревизия
c98bcdc126

+ 1 - 1
package.json

@@ -32,7 +32,7 @@
     "commander": "8.2.0",
     "commander": "8.2.0",
     "eslint-scope": "6.0.0",
     "eslint-scope": "6.0.0",
     "fast-deep-equal": "3.1.3",
     "fast-deep-equal": "3.1.3",
-    "inversify": "5.1.1",
+    "inversify": "6.0.1",
     "js-string-escape": "1.0.1",
     "js-string-escape": "1.0.1",
     "md5": "2.3.0",
     "md5": "2.3.0",
     "mkdirp": "1.0.4",
     "mkdirp": "1.0.4",

+ 1 - 1
src/code-transformers/AbstractCodeTransformer.ts

@@ -29,7 +29,7 @@ export abstract class AbstractCodeTransformer implements ICodeTransformer {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 12 - 11
src/container/InversifyContainerFacade.ts

@@ -22,6 +22,7 @@ import { storagesModule } from './modules/storages/StoragesModule';
 import { stringArrayTransformersModule } from './modules/node-transformers/StringArrayTransformersModule';
 import { stringArrayTransformersModule } from './modules/node-transformers/StringArrayTransformersModule';
 import { utilsModule } from './modules/utils/UtilsModule';
 import { utilsModule } from './modules/utils/UtilsModule';
 
 
+import { TConstructor } from '../types/TConstructor';
 import { TInputOptions } from '../types/options/TInputOptions';
 import { TInputOptions } from '../types/options/TInputOptions';
 
 
 import { ICodeTransformersRunner } from '../interfaces/code-transformers/ICodeTransformersRunner';
 import { ICodeTransformersRunner } from '../interfaces/code-transformers/ICodeTransformersRunner';
@@ -88,21 +89,21 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
     }
     }
 
 
     /**
     /**
-     * @param {interfaces.ServiceIdentifier<interfaces.Newable<U>>} serviceIdentifier
-     * @param {interfaces.ServiceIdentifier<interfaces.Newable<Object>>[]} dependencies
-     * @returns {U}
+     * @param {interfaces.ServiceIdentifier<TConstructor<Record<string, any>[], U>>} serviceIdentifier
+     * @param {interfaces.ServiceIdentifier<TConstructor<Record<string, any>[], U>>} dependencies
+     * @returns {(context: interfaces.Context) => (bindingName: T) => U}
      */
      */
     public static getConstructorFactory <T extends string, U> (
     public static getConstructorFactory <T extends string, U> (
-        serviceIdentifier: interfaces.ServiceIdentifier<interfaces.Newable<U>>,
-        ...dependencies: interfaces.ServiceIdentifier<interfaces.Newable<Record<string, any>>>[]
+        serviceIdentifier: interfaces.ServiceIdentifier<TConstructor<Record<string, any>[], U>>,
+        ...dependencies: interfaces.ServiceIdentifier<TConstructor<Record<string, any>[], U>>[]
     ): (context: interfaces.Context) => (bindingName: T) => U {
     ): (context: interfaces.Context) => (bindingName: T) => U {
         return (context: interfaces.Context): (bindingName: T) => U => {
         return (context: interfaces.Context): (bindingName: T) => U => {
-            const cache: Map<T, interfaces.Newable<U>> = new Map();
+            const cache: Map<T, TConstructor<Record<string, any>[], U>> = new Map();
             const cachedDependencies: Record<string, any>[] = [];
             const cachedDependencies: Record<string, any>[] = [];
 
 
             return (bindingName: T): U => {
             return (bindingName: T): U => {
                 dependencies.forEach((
                 dependencies.forEach((
-                    dependency: interfaces.ServiceIdentifier<interfaces.Newable<Record<string, any>>>,
+                    dependency: interfaces.ServiceIdentifier<TConstructor<Record<string, any>[], U>>,
                     index: number
                     index: number
                 ) => {
                 ) => {
                     if (!cachedDependencies[index]) {
                     if (!cachedDependencies[index]) {
@@ -111,11 +112,11 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
                 });
                 });
 
 
                 if (cache.has(bindingName)) {
                 if (cache.has(bindingName)) {
-                    return new (<interfaces.Newable<U>>cache.get(bindingName))(...cachedDependencies);
+                    return new (<TConstructor<Record<string, any>[], U>>cache.get(bindingName))(...cachedDependencies);
                 }
                 }
 
 
-                const constructor: interfaces.Newable<U> = context.container
-                    .getNamed<interfaces.Newable<U>>(
+                const constructor = context.container
+                    .getNamed<TConstructor<Record<string, any>[], U>>(
                         serviceIdentifier,
                         serviceIdentifier,
                         bindingName
                         bindingName
                     );
                     );
@@ -186,7 +187,7 @@ export class InversifyContainerFacade implements IInversifyContainerFacade {
 
 
         this.container
         this.container
             .bind<IObfuscationResult>(ServiceIdentifiers.Factory__IObfuscationResult)
             .bind<IObfuscationResult>(ServiceIdentifiers.Factory__IObfuscationResult)
-            .toFactory<IObfuscationResult>((context: interfaces.Context) => {
+            .toFactory<IObfuscationResult, [string, string]>((context: interfaces.Context) => {
                 return (obfuscatedCodeAsString: string, sourceMapAsString: string): IObfuscationResult => {
                 return (obfuscatedCodeAsString: string, sourceMapAsString: string): IObfuscationResult => {
                     const obfuscationResult: IObfuscationResult = context.container
                     const obfuscationResult: IObfuscationResult = context.container
                         .get<IObfuscationResult>(ServiceIdentifiers.IObfuscationResult);
                         .get<IObfuscationResult>(ServiceIdentifiers.IObfuscationResult);

+ 1 - 1
src/container/modules/analyzers/AnalyzersModule.ts

@@ -60,7 +60,7 @@ export const analyzersModule: interfaces.ContainerModule = new ContainerModule((
 
 
     // callee data extractor factory
     // callee data extractor factory
     bind<ICalleeDataExtractor>(ServiceIdentifiers.Factory__ICalleeDataExtractor)
     bind<ICalleeDataExtractor>(ServiceIdentifiers.Factory__ICalleeDataExtractor)
-        .toFactory<ICalleeDataExtractor>(InversifyContainerFacade
+        .toFactory<ICalleeDataExtractor, [CalleeDataExtractor]>(InversifyContainerFacade
             .getCacheFactory<CalleeDataExtractor, ICalleeDataExtractor>(
             .getCacheFactory<CalleeDataExtractor, ICalleeDataExtractor>(
                 ServiceIdentifiers.ICalleeDataExtractor
                 ServiceIdentifiers.ICalleeDataExtractor
             ));
             ));

+ 1 - 1
src/container/modules/code-transformers/CodeTransformersModule.ts

@@ -13,7 +13,7 @@ import { HashbangOperatorTransformer } from '../../../code-transformers/preparin
 export const codeTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
 export const codeTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
     // code transformers factory
     // code transformers factory
     bind<ICodeTransformer>(ServiceIdentifiers.Factory__ICodeTransformer)
     bind<ICodeTransformer>(ServiceIdentifiers.Factory__ICodeTransformer)
-        .toFactory<ICodeTransformer>(InversifyContainerFacade
+        .toFactory<ICodeTransformer, [CodeTransformer]>(InversifyContainerFacade
             .getCacheFactory<CodeTransformer, ICodeTransformer>(ServiceIdentifiers.ICodeTransformer));
             .getCacheFactory<CodeTransformer, ICodeTransformer>(ServiceIdentifiers.ICodeTransformer));
 
 
     // code transformer names groups builder
     // code transformer names groups builder

+ 2 - 2
src/container/modules/custom-code-helpers/CustomCodeHelpersModule.ts

@@ -104,12 +104,12 @@ export const customCodeHelpersModule: interfaces.ContainerModule = new Container
 
 
     // customCodeHelper factory
     // customCodeHelper factory
     bind<ICustomCodeHelper>(ServiceIdentifiers.Factory__ICustomCodeHelper)
     bind<ICustomCodeHelper>(ServiceIdentifiers.Factory__ICustomCodeHelper)
-        .toFactory<ICustomCodeHelper>(InversifyContainerFacade
+        .toFactory<ICustomCodeHelper, [CustomCodeHelper]>(InversifyContainerFacade
             .getFactory<CustomCodeHelper, ICustomCodeHelper>(ServiceIdentifiers.ICustomCodeHelper));
             .getFactory<CustomCodeHelper, ICustomCodeHelper>(ServiceIdentifiers.ICustomCodeHelper));
 
 
     // customCodeHelperGroup factory
     // customCodeHelperGroup factory
     bind<ICustomCodeHelperGroup>(ServiceIdentifiers.Factory__ICustomCodeHelperGroup)
     bind<ICustomCodeHelperGroup>(ServiceIdentifiers.Factory__ICustomCodeHelperGroup)
-        .toFactory<ICustomCodeHelperGroup>(InversifyContainerFacade
+        .toFactory<ICustomCodeHelperGroup, [CustomCodeHelperGroup]>(InversifyContainerFacade
             .getFactory<CustomCodeHelperGroup, ICustomCodeHelperGroup>(ServiceIdentifiers.ICustomCodeHelperGroup));
             .getFactory<CustomCodeHelperGroup, ICustomCodeHelperGroup>(ServiceIdentifiers.ICustomCodeHelperGroup));
 
 
     // custom code helper formatter
     // custom code helper formatter

+ 5 - 5
src/container/modules/custom-nodes/CustomNodesModule.ts

@@ -102,7 +102,7 @@ export const customNodesModule: interfaces.ContainerModule = new ContainerModule
 
 
     // control flow customNode constructor factory
     // control flow customNode constructor factory
     bind<ICustomNode>(ServiceIdentifiers.Factory__IControlFlowCustomNode)
     bind<ICustomNode>(ServiceIdentifiers.Factory__IControlFlowCustomNode)
-        .toFactory<ICustomNode>(InversifyContainerFacade
+        .toFactory<ICustomNode, [ControlFlowCustomNode]>(InversifyContainerFacade
             .getConstructorFactory<ControlFlowCustomNode, ICustomNode>(
             .getConstructorFactory<ControlFlowCustomNode, ICustomNode>(
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
@@ -113,7 +113,7 @@ export const customNodesModule: interfaces.ContainerModule = new ContainerModule
 
 
     // dead code injection customNode constructor factory
     // dead code injection customNode constructor factory
     bind<ICustomNode>(ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)
     bind<ICustomNode>(ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)
-        .toFactory<ICustomNode>(InversifyContainerFacade
+        .toFactory<ICustomNode, [DeadCodeInjectionCustomNode]>(InversifyContainerFacade
             .getConstructorFactory<DeadCodeInjectionCustomNode, ICustomNode>(
             .getConstructorFactory<DeadCodeInjectionCustomNode, ICustomNode>(
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
@@ -124,7 +124,7 @@ export const customNodesModule: interfaces.ContainerModule = new ContainerModule
 
 
     // object expression keys transformer customNode constructor factory
     // object expression keys transformer customNode constructor factory
     bind<ICustomNode>(ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)
     bind<ICustomNode>(ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)
-        .toFactory<ICustomNode>(InversifyContainerFacade
+        .toFactory<ICustomNode, [ObjectExpressionKeysTransformerCustomNode]>(InversifyContainerFacade
             .getConstructorFactory<ObjectExpressionKeysTransformerCustomNode, ICustomNode>(
             .getConstructorFactory<ObjectExpressionKeysTransformerCustomNode, ICustomNode>(
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
@@ -135,7 +135,7 @@ export const customNodesModule: interfaces.ContainerModule = new ContainerModule
 
 
     // string array customNode constructor factory
     // string array customNode constructor factory
     bind<ICustomNode>(ServiceIdentifiers.Factory__IStringArrayCustomNode)
     bind<ICustomNode>(ServiceIdentifiers.Factory__IStringArrayCustomNode)
-        .toFactory<ICustomNode>(InversifyContainerFacade
+        .toFactory<ICustomNode, [StringArrayCustomNode]>(InversifyContainerFacade
             .getConstructorFactory<StringArrayCustomNode, ICustomNode>(
             .getConstructorFactory<StringArrayCustomNode, ICustomNode>(
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Newable__ICustomNode,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
                 ServiceIdentifiers.Factory__IIdentifierNamesGenerator,
@@ -149,6 +149,6 @@ export const customNodesModule: interfaces.ContainerModule = new ContainerModule
 
 
     // string array index node factory
     // string array index node factory
     bind<IStringArrayIndexNode>(ServiceIdentifiers.Factory__IStringArrayIndexNode)
     bind<IStringArrayIndexNode>(ServiceIdentifiers.Factory__IStringArrayIndexNode)
-        .toFactory<IStringArrayIndexNode>(InversifyContainerFacade
+        .toFactory<IStringArrayIndexNode, [StringArrayIndexNode]>(InversifyContainerFacade
             .getCacheFactory<StringArrayIndexNode, IStringArrayIndexNode>(ServiceIdentifiers.IStringArrayIndexNode));
             .getCacheFactory<StringArrayIndexNode, IStringArrayIndexNode>(ServiceIdentifiers.IStringArrayIndexNode));
 });
 });

+ 1 - 1
src/container/modules/generators/GeneratorsModule.ts

@@ -83,5 +83,5 @@ export const generatorsModule: interfaces.ContainerModule = new ContainerModule(
         };
         };
     }
     }
     bind<IIdentifierNamesGenerator>(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
     bind<IIdentifierNamesGenerator>(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
-        .toFactory<IIdentifierNamesGenerator>(identifierNameGeneratorFactory());
+        .toFactory<IIdentifierNamesGenerator, [IOptions]>(identifierNameGeneratorFactory());
 });
 });

+ 1 - 1
src/container/modules/node-transformers/ControlFlowTransformersModule.ts

@@ -44,6 +44,6 @@ export const controlFlowTransformersModule: interfaces.ContainerModule = new Con
 
 
     // control flow replacer factory
     // control flow replacer factory
     bind<IControlFlowReplacer>(ServiceIdentifiers.Factory__IControlFlowReplacer)
     bind<IControlFlowReplacer>(ServiceIdentifiers.Factory__IControlFlowReplacer)
-        .toFactory<IControlFlowReplacer>(InversifyContainerFacade
+        .toFactory<IControlFlowReplacer, [ControlFlowReplacer]>(InversifyContainerFacade
             .getCacheFactory<ControlFlowReplacer, IControlFlowReplacer>(ServiceIdentifiers.IControlFlowReplacer));
             .getCacheFactory<ControlFlowReplacer, IControlFlowReplacer>(ServiceIdentifiers.IControlFlowReplacer));
 });
 });

+ 1 - 1
src/container/modules/node-transformers/ConvertingTransformersModule.ts

@@ -79,7 +79,7 @@ export const convertingTransformersModule: interfaces.ContainerModule = new Cont
 
 
     // object expression extractor factory
     // object expression extractor factory
     bind<IObjectExpressionExtractor>(ServiceIdentifiers.Factory__IObjectExpressionExtractor)
     bind<IObjectExpressionExtractor>(ServiceIdentifiers.Factory__IObjectExpressionExtractor)
-        .toFactory<IObjectExpressionExtractor>(InversifyContainerFacade
+        .toFactory<IObjectExpressionExtractor, [ObjectExpressionExtractor]>(InversifyContainerFacade
             .getCacheFactory<ObjectExpressionExtractor, IObjectExpressionExtractor>(
             .getCacheFactory<ObjectExpressionExtractor, IObjectExpressionExtractor>(
                 ServiceIdentifiers.IObjectExpressionExtractor
                 ServiceIdentifiers.IObjectExpressionExtractor
             ));
             ));

+ 1 - 1
src/container/modules/node-transformers/NodeTransformersModule.ts

@@ -12,7 +12,7 @@ import { NodeTransformerNamesGroupsBuilder } from '../../../node-transformers/No
 export const nodeTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
 export const nodeTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
     // node transformers factory
     // node transformers factory
     bind<INodeTransformer>(ServiceIdentifiers.Factory__INodeTransformer)
     bind<INodeTransformer>(ServiceIdentifiers.Factory__INodeTransformer)
-        .toFactory<INodeTransformer>(InversifyContainerFacade
+        .toFactory<INodeTransformer, [NodeTransformer]>(InversifyContainerFacade
             .getCacheFactory<NodeTransformer, INodeTransformer>(ServiceIdentifiers.INodeTransformer));
             .getCacheFactory<NodeTransformer, INodeTransformer>(ServiceIdentifiers.INodeTransformer));
 
 
     // node transformer names groups builder
     // node transformer names groups builder

+ 1 - 1
src/container/modules/node-transformers/PreparingTransformersModule.ts

@@ -74,7 +74,7 @@ export const preparingTransformersModule: interfaces.ContainerModule = new Conta
 
 
     // obfuscating guards factory
     // obfuscating guards factory
     bind<IObfuscatingGuard>(ServiceIdentifiers.Factory__INodeGuard)
     bind<IObfuscatingGuard>(ServiceIdentifiers.Factory__INodeGuard)
-        .toFactory<IObfuscatingGuard>(InversifyContainerFacade
+        .toFactory<IObfuscatingGuard, [ObfuscatingGuard]>(InversifyContainerFacade
             .getCacheFactory<ObfuscatingGuard, IObfuscatingGuard>(
             .getCacheFactory<ObfuscatingGuard, IObfuscatingGuard>(
                 ServiceIdentifiers.INodeGuard
                 ServiceIdentifiers.INodeGuard
             ));
             ));

+ 5 - 2
src/container/modules/storages/StoragesModule.ts

@@ -2,6 +2,7 @@ import { ContainerModule, interfaces } from 'inversify';
 import { ServiceIdentifiers } from '../../ServiceIdentifiers';
 import { ServiceIdentifiers } from '../../ServiceIdentifiers';
 
 
 import { TControlFlowStorage } from '../../../types/storages/TControlFlowStorage';
 import { TControlFlowStorage } from '../../../types/storages/TControlFlowStorage';
+import { TConstructor } from '../../../types/TConstructor';
 import { TCustomCodeHelperGroupStorage } from '../../../types/storages/TCustomCodeHelperGroupStorage';
 import { TCustomCodeHelperGroupStorage } from '../../../types/storages/TCustomCodeHelperGroupStorage';
 
 
 import { IGlobalIdentifierNamesCacheStorage } from '../../../interfaces/storages/identifier-names-cache/IGlobalIdentifierNamesCacheStorage';
 import { IGlobalIdentifierNamesCacheStorage } from '../../../interfaces/storages/identifier-names-cache/IGlobalIdentifierNamesCacheStorage';
@@ -59,8 +60,10 @@ export const storagesModule: interfaces.ContainerModule = new ContainerModule((b
     bind<TControlFlowStorage>(ServiceIdentifiers.Factory__TControlFlowStorage)
     bind<TControlFlowStorage>(ServiceIdentifiers.Factory__TControlFlowStorage)
         .toFactory<TControlFlowStorage>((context: interfaces.Context) => {
         .toFactory<TControlFlowStorage>((context: interfaces.Context) => {
             return (): TControlFlowStorage => {
             return (): TControlFlowStorage => {
-                const constructor: interfaces.Newable<TControlFlowStorage> = context.container
-                    .get<interfaces.Newable<TControlFlowStorage>>(ServiceIdentifiers.Newable__TControlFlowStorage);
+                const constructor = context.container
+                    .get<TConstructor<[IRandomGenerator, IOptions], TControlFlowStorage>>(
+                        ServiceIdentifiers.Newable__TControlFlowStorage
+                    );
                 const randomGenerator: IRandomGenerator = context.container
                 const randomGenerator: IRandomGenerator = context.container
                     .get<IRandomGenerator>(ServiceIdentifiers.IRandomGenerator);
                     .get<IRandomGenerator>(ServiceIdentifiers.IRandomGenerator);
                 const options: IOptions = context.container
                 const options: IOptions = context.container

+ 1 - 1
src/custom-code-helpers/AbstractCustomCodeHelper.ts

@@ -63,7 +63,7 @@ export abstract class AbstractCustomCodeHelper <
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomCodeHelperFormatter) customCodeHelperFormatter: ICustomCodeHelperFormatter,
         @inject(ServiceIdentifiers.ICustomCodeHelperFormatter) customCodeHelperFormatter: ICustomCodeHelperFormatter,

+ 1 - 1
src/custom-nodes/AbstractCustomNode.ts

@@ -45,7 +45,7 @@ export abstract class AbstractCustomNode <
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.ICustomCodeHelperFormatter) customCodeHelperFormatter: ICustomCodeHelperFormatter,
         @inject(ServiceIdentifiers.ICustomCodeHelperFormatter) customCodeHelperFormatter: ICustomCodeHelperFormatter,

+ 1 - 1
src/custom-nodes/string-array-nodes/AbstractStringArrayCallNode.ts

@@ -62,7 +62,7 @@ export abstract class AbstractStringArrayCallNode extends AbstractCustomNode {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
         @inject(ServiceIdentifiers.Factory__IIdentifierNamesGenerator)
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
             identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory,
         @inject(ServiceIdentifiers.Factory__IStringArrayIndexNode)
         @inject(ServiceIdentifiers.Factory__IStringArrayIndexNode)

+ 1 - 1
src/custom-nodes/string-array-nodes/string-array-index-nodes/AbstractStringArrayIndexNode.ts

@@ -24,7 +24,7 @@ export abstract class AbstractStringArrayIndexNode implements IStringArrayIndexN
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 1 - 1
src/node-transformers/simplifying-transformers/AbstractStatementSimplifyTransformer.ts

@@ -31,7 +31,7 @@ export abstract class AbstractStatementSimplifyTransformer extends AbstractNodeT
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 1 - 1
src/storages/ArrayStorage.ts

@@ -40,7 +40,7 @@ export abstract class ArrayStorage <V> implements IArrayStorage <V> {
      * @param {IRandomGenerator} randomGenerator
      * @param {IRandomGenerator} randomGenerator
      * @param {IOptions} options
      * @param {IOptions} options
      */
      */
-    protected constructor (
+    public constructor (
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
     ) {

+ 1 - 0
src/types/TConstructor.ts

@@ -0,0 +1 @@
+export type TConstructor<TArgs extends any[], TInstanceType> = new (...args: TArgs) => TInstanceType;

+ 4 - 4
yarn.lock

@@ -2683,10 +2683,10 @@ interpret@^2.2.0:
   resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz"
   resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz"
   integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
   integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
 
 
-inversify@5.1.1:
-  version "5.1.1"
-  resolved "https://registry.yarnpkg.com/inversify/-/inversify-5.1.1.tgz#6fbd668c591337404e005a1946bfe0d802c08730"
-  integrity sha512-j8grHGDzv1v+8T1sAQ+3boTCntFPfvxLCkNcxB1J8qA0lUN+fAlSyYd+RXKvaPRL4AGyPxViutBEJHNXOyUdFQ==
+inversify@6.0.1:
+  version "6.0.1"
+  resolved "https://registry.yarnpkg.com/inversify/-/inversify-6.0.1.tgz#b20d35425d5d8c5cd156120237aad0008d969f02"
+  integrity sha512-B3ex30927698TJENHR++8FfEaJGqoWOgI6ZY5Ht/nLUsFCwHn6akbwtnUAPCgUepAnTpe2qHxhDNjoKLyz6rgQ==
 
 
 is-arguments@^1.0.4:
 is-arguments@^1.0.4:
   version "1.0.4"
   version "1.0.4"