javascript-obfuscator 2.19.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +58 -33
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cli.js +1 -1
- package/dist/index.cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +35 -33
- package/typings/src/code-transformers/AbstractCodeTransformer.d.ts +1 -1
- package/typings/src/container/InversifyContainerFacade.d.ts +2 -1
- package/typings/src/container/ServiceIdentifiers.d.ts +2 -1
- package/typings/src/custom-code-helpers/AbstractCustomCodeHelper.d.ts +1 -1
- package/typings/src/custom-nodes/AbstractCustomNode.d.ts +1 -1
- package/typings/src/custom-nodes/control-flow-flattening-nodes/{StringLiteralNode.d.ts → LiteralNode.d.ts} +4 -3
- package/typings/src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.d.ts +2 -2
- package/typings/src/custom-nodes/string-array-nodes/AbstractStringArrayCallNode.d.ts +1 -1
- package/typings/src/custom-nodes/string-array-nodes/string-array-index-nodes/AbstractStringArrayIndexNode.d.ts +1 -1
- package/typings/src/enums/custom-nodes/ControlFlowCustomNode.d.ts +2 -2
- package/typings/src/enums/node/NodeType.d.ts +2 -0
- package/typings/src/enums/node-transformers/NodeTransformer.d.ts +1 -0
- package/typings/src/enums/node-transformers/control-flow-transformers/control-flow-replacers/ControlFlowReplacer.d.ts +1 -0
- package/typings/src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.d.ts +1 -1
- package/typings/src/enums/storages/ControlFlowStorage.d.ts +4 -0
- package/typings/src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.d.ts +2 -1
- package/typings/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.d.ts +1 -0
- package/typings/src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.d.ts +1 -0
- package/typings/src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.d.ts +9 -2
- package/typings/src/generators/identifier-names-generators/MangledShuffledIdentifierNamesGenerator.d.ts +2 -2
- package/typings/src/interfaces/generators/identifier-names-generators/IIdentifierNamesGenerator.d.ts +1 -0
- package/typings/src/interfaces/node-transformers/control-flow-transformers/IControlFlowReplacer.d.ts +3 -2
- package/typings/src/interfaces/options/IOptions.d.ts +5 -3
- package/typings/src/interfaces/storages/IWeakMapStorage.d.ts +9 -0
- package/typings/src/interfaces/storages/control-flow-transformers/IControlFlowStorage.d.ts +4 -0
- package/typings/src/interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrappersDataStorage.d.ts +2 -2
- package/typings/src/interfaces/utils/ISetUtils.d.ts +3 -0
- package/typings/src/node/NodeFactory.d.ts +1 -0
- package/typings/src/node/NodeGuards.d.ts +2 -0
- package/typings/src/node/NodeLiteralUtils.d.ts +2 -0
- package/typings/src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.d.ts +22 -13
- package/typings/src/node-transformers/control-flow-transformers/StringArrayControlFlowTransformer.d.ts +25 -0
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.d.ts +8 -5
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.d.ts +4 -3
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.d.ts +4 -3
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.d.ts +2 -1
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.d.ts +4 -3
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/StringArrayCallControlFlowReplacer.d.ts +14 -0
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.d.ts +5 -4
- package/typings/src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.d.ts +0 -2
- package/typings/src/node-transformers/preparing-transformers/obfuscating-guards/{IgnoredRequireImportObfuscatingGuard.d.ts → IgnoredImportObfuscatingGuard.d.ts} +3 -1
- package/typings/src/node-transformers/simplifying-transformers/AbstractStatementSimplifyTransformer.d.ts +1 -1
- package/typings/src/options/Options.d.ts +5 -3
- package/typings/src/options/normalizer-rules/StringArrayCallsTransformThresholdRule.d.ts +2 -0
- package/typings/src/storages/ArrayStorage.d.ts +1 -1
- package/typings/src/storages/WeakMapStorage.d.ts +17 -0
- package/typings/src/storages/control-flow-transformers/FunctionControlFlowStorage.d.ts +11 -0
- package/typings/src/storages/control-flow-transformers/StringControlFlowStorage.d.ts +8 -0
- package/typings/src/storages/string-array-transformers/StringArrayScopeCallsWrappersDataStorage.d.ts +2 -2
- package/typings/src/types/TConstructor.d.ts +1 -0
- package/typings/src/types/container/node-transformers/TControlFlowStorageFactory.d.ts +2 -2
- package/typings/src/types/container/node-transformers/TControlFlowStorageFactoryCreator.d.ts +3 -0
- package/typings/src/types/node/TNumberLiteralNode.d.ts +4 -0
- package/typings/src/utils/SetUtils.d.ts +7 -0
- package/typings/src/storages/custom-nodes/ControlFlowStorage.d.ts +0 -7
- package/typings/src/types/storages/TControlFlowStorage.d.ts +0 -3
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
-
import {
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
4
|
import { IControlFlowReplacer } from '../../../interfaces/node-transformers/control-flow-transformers/IControlFlowReplacer';
|
|
5
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
5
6
|
import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode';
|
|
7
|
+
import { IIdentifierNamesGenerator } from '../../../interfaces/generators/identifier-names-generators/IIdentifierNamesGenerator';
|
|
6
8
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
7
9
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
8
10
|
export declare abstract class AbstractControlFlowReplacer implements IControlFlowReplacer {
|
|
9
11
|
protected readonly controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory;
|
|
12
|
+
protected readonly identifierNamesGenerator: IIdentifierNamesGenerator;
|
|
10
13
|
protected readonly options: IOptions;
|
|
11
14
|
protected readonly randomGenerator: IRandomGenerator;
|
|
12
15
|
protected readonly replacerDataByControlFlowStorageId: Map<string, Map<string, string[]>>;
|
|
13
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
14
|
-
|
|
15
|
-
protected insertCustomNodeToControlFlowStorage(customNode: ICustomNode, controlFlowStorage:
|
|
16
|
-
abstract replace(node: ESTree.Node, parentNode: ESTree.Node, controlFlowStorage:
|
|
16
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
17
|
+
generateStorageKey(controlFlowStorage: IControlFlowStorage): string;
|
|
18
|
+
protected insertCustomNodeToControlFlowStorage(customNode: ICustomNode, controlFlowStorage: IControlFlowStorage, replacerId: string, usingExistingIdentifierChance: number): string;
|
|
19
|
+
abstract replace(node: ESTree.Node, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
17
20
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
-
import {
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
4
5
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
5
6
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
6
7
|
import { ExpressionWithOperatorControlFlowReplacer } from './ExpressionWithOperatorControlFlowReplacer';
|
|
7
8
|
export declare class BinaryExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer {
|
|
8
9
|
private static readonly usingExistingIdentifierChance;
|
|
9
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
|
-
replace(binaryExpressionNode: ESTree.BinaryExpression, parentNode: ESTree.Node, controlFlowStorage:
|
|
10
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
|
+
replace(binaryExpressionNode: ESTree.BinaryExpression, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
11
12
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
-
import {
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
4
5
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
5
6
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
6
7
|
import { AbstractControlFlowReplacer } from './AbstractControlFlowReplacer';
|
|
7
8
|
export declare class CallExpressionControlFlowReplacer extends AbstractControlFlowReplacer {
|
|
8
9
|
private static readonly usingExistingIdentifierChance;
|
|
9
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
|
-
replace(callExpressionNode: ESTree.CallExpression, parentNode: ESTree.Node, controlFlowStorage:
|
|
10
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
|
+
replace(callExpressionNode: ESTree.CallExpression, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
11
12
|
protected getControlFlowStorageCallNode(controlFlowStorageId: string, storageKey: string, callee: ESTree.Expression, expressionArguments: (ESTree.Expression | ESTree.SpreadElement)[]): ESTree.Node;
|
|
12
13
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
3
4
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
4
5
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
5
6
|
import { AbstractControlFlowReplacer } from './AbstractControlFlowReplacer';
|
|
6
7
|
export declare abstract class ExpressionWithOperatorControlFlowReplacer extends AbstractControlFlowReplacer {
|
|
7
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
8
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
8
9
|
protected getControlFlowStorageCallNode(controlFlowStorageId: string, storageKey: string, leftExpression: ESTree.Expression, rightExpression: ESTree.Expression): ESTree.Node;
|
|
9
10
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
-
import {
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
4
5
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
5
6
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
6
7
|
import { ExpressionWithOperatorControlFlowReplacer } from './ExpressionWithOperatorControlFlowReplacer';
|
|
7
8
|
export declare class LogicalExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer {
|
|
8
9
|
private static readonly usingExistingIdentifierChance;
|
|
9
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
|
-
replace(logicalExpressionNode: ESTree.LogicalExpression, parentNode: ESTree.Node, controlFlowStorage:
|
|
10
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
|
+
replace(logicalExpressionNode: ESTree.LogicalExpression, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
11
12
|
private checkForProhibitedExpressions;
|
|
12
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as ESTree from 'estree';
|
|
2
|
+
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
5
|
+
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
6
|
+
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
7
|
+
import { AbstractControlFlowReplacer } from './AbstractControlFlowReplacer';
|
|
8
|
+
export declare class StringArrayCallControlFlowReplacer extends AbstractControlFlowReplacer {
|
|
9
|
+
private static readonly usingExistingIdentifierChance;
|
|
10
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
|
+
replace(literalNode: ESTree.Literal, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
12
|
+
generateStorageKey(controlFlowStorage: IControlFlowStorage): string;
|
|
13
|
+
protected getControlFlowStorageCallNode(controlFlowStorageId: string, storageKey: string): ESTree.Node;
|
|
14
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as ESTree from 'estree';
|
|
2
2
|
import { TControlFlowCustomNodeFactory } from '../../../types/container/custom-nodes/TControlFlowCustomNodeFactory';
|
|
3
|
-
import {
|
|
3
|
+
import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
4
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
4
5
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
5
6
|
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
|
|
6
7
|
import { AbstractControlFlowReplacer } from './AbstractControlFlowReplacer';
|
|
7
8
|
export declare class StringLiteralControlFlowReplacer extends AbstractControlFlowReplacer {
|
|
8
|
-
|
|
9
|
-
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
|
-
replace(literalNode: ESTree.Literal, parentNode: ESTree.Node, controlFlowStorage:
|
|
9
|
+
protected static readonly usingExistingIdentifierChance: number;
|
|
10
|
+
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
|
+
replace(literalNode: ESTree.Literal, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
11
12
|
protected getControlFlowStorageCallNode(controlFlowStorageId: string, storageKey: string): ESTree.Node;
|
|
12
13
|
}
|
|
@@ -6,7 +6,6 @@ import { IOptions } from '../../interfaces/options/IOptions';
|
|
|
6
6
|
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
|
|
7
7
|
import { INodeTransformersRunner } from '../../interfaces/node-transformers/INodeTransformersRunner';
|
|
8
8
|
import { IVisitor } from '../../interfaces/node-transformers/IVisitor';
|
|
9
|
-
import { NodeTransformer } from '../../enums/node-transformers/NodeTransformer';
|
|
10
9
|
import { NodeTransformationStage } from '../../enums/node-transformers/NodeTransformationStage';
|
|
11
10
|
import { AbstractNodeTransformer } from '../AbstractNodeTransformer';
|
|
12
11
|
export declare class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
|
|
@@ -14,7 +13,6 @@ export declare class DeadCodeInjectionTransformer extends AbstractNodeTransforme
|
|
|
14
13
|
private static readonly maxNestedBlockStatementsCount;
|
|
15
14
|
private static readonly minCollectedBlockStatementsCount;
|
|
16
15
|
private static readonly transformersToRenameBlockScopeIdentifiers;
|
|
17
|
-
readonly runAfter: NodeTransformer[];
|
|
18
16
|
private readonly deadCodeInjectionRootAstHostNodeSet;
|
|
19
17
|
private readonly collectedBlockStatements;
|
|
20
18
|
private collectedBlockStatementsTotalLength;
|
|
@@ -2,8 +2,10 @@ import * as ESTree from 'estree';
|
|
|
2
2
|
import { IObfuscatingGuard } from '../../../interfaces/node-transformers/preparing-transformers/obfuscating-guards/IObfuscatingGuard';
|
|
3
3
|
import { IOptions } from '../../../interfaces/options/IOptions';
|
|
4
4
|
import { ObfuscatingGuardResult } from '../../../enums/node/ObfuscatingGuardResult';
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class IgnoredImportObfuscatingGuard implements IObfuscatingGuard {
|
|
6
6
|
private readonly options;
|
|
7
7
|
constructor(options: IOptions);
|
|
8
|
+
private static isDynamicImport;
|
|
9
|
+
private static isRequireImport;
|
|
8
10
|
check(node: ESTree.Node): ObfuscatingGuardResult;
|
|
9
11
|
}
|
|
@@ -7,7 +7,7 @@ import { NodeTransformer } from '../../enums/node-transformers/NodeTransformer';
|
|
|
7
7
|
import { AbstractNodeTransformer } from '../AbstractNodeTransformer';
|
|
8
8
|
export declare abstract class AbstractStatementSimplifyTransformer extends AbstractNodeTransformer {
|
|
9
9
|
readonly runAfter: NodeTransformer[];
|
|
10
|
-
|
|
10
|
+
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
11
|
protected getStatementSimplifyData(statementNode: ESTree.Statement | null | undefined): IStatementSimplifyData | null;
|
|
12
12
|
protected collectIteratedStatementsSimplifyData(statementNode: ESTree.BlockStatement): IIteratedStatementsSimplifyData;
|
|
13
13
|
protected getLeadingStatements(statementNode: ESTree.BlockStatement, startIndex: number | null): ESTree.Statement[];
|
|
@@ -30,7 +30,7 @@ export declare class Options implements IOptions {
|
|
|
30
30
|
readonly identifierNamesGenerator: TTypeFromEnum<typeof IdentifierNamesGenerator>;
|
|
31
31
|
readonly identifiersPrefix: string;
|
|
32
32
|
readonly identifiersDictionary: string[];
|
|
33
|
-
readonly
|
|
33
|
+
readonly ignoreImports: boolean;
|
|
34
34
|
readonly inputFileName: string;
|
|
35
35
|
readonly log: boolean;
|
|
36
36
|
readonly numbersToExpressions: boolean;
|
|
@@ -40,9 +40,7 @@ export declare class Options implements IOptions {
|
|
|
40
40
|
readonly renamePropertiesMode: TRenamePropertiesMode;
|
|
41
41
|
readonly reservedNames: string[];
|
|
42
42
|
readonly reservedStrings: string[];
|
|
43
|
-
readonly rotateStringArray: boolean;
|
|
44
43
|
readonly selfDefending: boolean;
|
|
45
|
-
readonly shuffleStringArray: boolean;
|
|
46
44
|
readonly simplify: boolean;
|
|
47
45
|
readonly sourceMap: boolean;
|
|
48
46
|
readonly sourceMapBaseUrl: string;
|
|
@@ -52,9 +50,13 @@ export declare class Options implements IOptions {
|
|
|
52
50
|
readonly splitStrings: boolean;
|
|
53
51
|
readonly splitStringsChunkLength: number;
|
|
54
52
|
readonly stringArray: boolean;
|
|
53
|
+
readonly stringArrayCallsTransform: boolean;
|
|
54
|
+
readonly stringArrayCallsTransformThreshold: number;
|
|
55
55
|
readonly stringArrayEncoding: TStringArrayEncoding[];
|
|
56
56
|
readonly stringArrayIndexesType: TStringArrayIndexesType[];
|
|
57
57
|
readonly stringArrayIndexShift: boolean;
|
|
58
|
+
readonly stringArrayRotate: boolean;
|
|
59
|
+
readonly stringArrayShuffle: boolean;
|
|
58
60
|
readonly stringArrayWrappersChainedCalls: boolean;
|
|
59
61
|
readonly stringArrayWrappersCount: number;
|
|
60
62
|
readonly stringArrayWrappersParametersMaxCount: number;
|
|
@@ -7,7 +7,7 @@ export declare abstract class ArrayStorage<V> implements IArrayStorage<V> {
|
|
|
7
7
|
protected readonly randomGenerator: IRandomGenerator;
|
|
8
8
|
protected readonly options: IOptions;
|
|
9
9
|
private storageLength;
|
|
10
|
-
|
|
10
|
+
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
11
|
initialize(): void;
|
|
12
12
|
delete(key: number): V | undefined;
|
|
13
13
|
get(key: number): V | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IOptions } from '../interfaces/options/IOptions';
|
|
2
|
+
import { IRandomGenerator } from '../interfaces/utils/IRandomGenerator';
|
|
3
|
+
import { IWeakMapStorage } from '../interfaces/storages/IWeakMapStorage';
|
|
4
|
+
export declare abstract class WeakMapStorage<K extends object, V> implements IWeakMapStorage<K, V> {
|
|
5
|
+
protected storageId: string;
|
|
6
|
+
protected storage: WeakMap<K, V>;
|
|
7
|
+
protected readonly options: IOptions;
|
|
8
|
+
protected readonly randomGenerator: IRandomGenerator;
|
|
9
|
+
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
|
+
initialize(): void;
|
|
11
|
+
get(key: K): V | undefined;
|
|
12
|
+
getOrThrow(key: K): V;
|
|
13
|
+
getStorage(): WeakMap<K, V>;
|
|
14
|
+
getStorageId(): string;
|
|
15
|
+
has(key: K): boolean;
|
|
16
|
+
set(key: K, value: V): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TIdentifierNamesGeneratorFactory } from '../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
2
|
+
import { IControlFlowStorage } from '../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
3
|
+
import { ICustomNode } from '../../interfaces/custom-nodes/ICustomNode';
|
|
4
|
+
import { IIdentifierNamesGenerator } from '../../interfaces/generators/identifier-names-generators/IIdentifierNamesGenerator';
|
|
5
|
+
import { IOptions } from '../../interfaces/options/IOptions';
|
|
6
|
+
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
|
|
7
|
+
import { MapStorage } from '../MapStorage';
|
|
8
|
+
export declare class FunctionControlFlowStorage extends MapStorage<string, ICustomNode> implements IControlFlowStorage {
|
|
9
|
+
protected readonly identifierNamesGenerator: IIdentifierNamesGenerator;
|
|
10
|
+
constructor(randomGenerator: IRandomGenerator, options: IOptions, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory);
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TIdentifierNamesGeneratorFactory } from '../../types/container/generators/TIdentifierNamesGeneratorFactory';
|
|
2
|
+
import { IOptions } from '../../interfaces/options/IOptions';
|
|
3
|
+
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
|
|
4
|
+
import { FunctionControlFlowStorage } from './FunctionControlFlowStorage';
|
|
5
|
+
export declare class StringControlFlowStorage extends FunctionControlFlowStorage {
|
|
6
|
+
constructor(randomGenerator: IRandomGenerator, options: IOptions, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory);
|
|
7
|
+
initialize(): void;
|
|
8
|
+
}
|
package/typings/src/storages/string-array-transformers/StringArrayScopeCallsWrappersDataStorage.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TStringArrayScopeCallsWrappersDataByEncoding } from '../../types/node-t
|
|
|
3
3
|
import { IOptions } from '../../interfaces/options/IOptions';
|
|
4
4
|
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
|
|
5
5
|
import { IStringArrayScopeCallsWrappersDataStorage } from '../../interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrappersDataStorage';
|
|
6
|
-
import {
|
|
7
|
-
export declare class StringArrayScopeCallsWrappersDataStorage extends
|
|
6
|
+
import { WeakMapStorage } from '../WeakMapStorage';
|
|
7
|
+
export declare class StringArrayScopeCallsWrappersDataStorage extends WeakMapStorage<TNodeWithLexicalScopeStatements, TStringArrayScopeCallsWrappersDataByEncoding> implements IStringArrayScopeCallsWrappersDataStorage {
|
|
8
8
|
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TConstructor<TArgs extends any[], TInstanceType> = new (...args: TArgs) => TInstanceType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare type TControlFlowStorageFactory = () =>
|
|
1
|
+
import { IControlFlowStorage } from '../../../interfaces/storages/control-flow-transformers/IControlFlowStorage';
|
|
2
|
+
export declare type TControlFlowStorageFactory = () => IControlFlowStorage;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TControlFlowStorageFactory } from './TControlFlowStorageFactory';
|
|
2
|
+
import { ControlFlowStorage } from '../../../enums/storages/ControlFlowStorage';
|
|
3
|
+
export declare type TControlFlowStorageFactoryCreator = (controlFlowStorageName: ControlFlowStorage) => TControlFlowStorageFactory;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IArrayUtils } from '../interfaces/utils/IArrayUtils';
|
|
2
|
+
import { ISetUtils } from '../interfaces/utils/ISetUtils';
|
|
3
|
+
export declare class SetUtils implements ISetUtils {
|
|
4
|
+
private readonly arrayUtils;
|
|
5
|
+
constructor(arrayUtils: IArrayUtils);
|
|
6
|
+
getLastElement<T>(set: Set<T>): T | undefined;
|
|
7
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ICustomNode } from '../../interfaces/custom-nodes/ICustomNode';
|
|
2
|
-
import { IOptions } from '../../interfaces/options/IOptions';
|
|
3
|
-
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
|
|
4
|
-
import { MapStorage } from '../MapStorage';
|
|
5
|
-
export declare class ControlFlowStorage extends MapStorage<string, ICustomNode> {
|
|
6
|
-
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
7
|
-
}
|