forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtilsModule.ts
More file actions
47 lines (39 loc) · 2.01 KB
/
Copy pathUtilsModule.ts
File metadata and controls
47 lines (39 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { ContainerModule, interfaces } from 'inversify';
import { ServiceIdentifiers } from '../../ServiceIdentifiers';
import { IArrayUtils } from '../../../interfaces/utils/IArrayUtils';
import { ICryptUtils } from '../../../interfaces/utils/ICryptUtils';
import { ICryptUtilsStringArray } from '../../../interfaces/utils/ICryptUtilsStringArray';
import { IEscapeSequenceEncoder } from '../../../interfaces/utils/IEscapeSequenceEncoder';
import { ILevelledTopologicalSorter } from '../../../interfaces/utils/ILevelledTopologicalSorter';
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
import { ArrayUtils } from '../../../utils/ArrayUtils';
import { CryptUtils } from '../../../utils/CryptUtils';
import { CryptUtilsStringArray } from '../../../utils/CryptUtilsStringArray';
import { EscapeSequenceEncoder } from '../../../utils/EscapeSequenceEncoder';
import { LevelledTopologicalSorter } from '../../../utils/LevelledTopologicalSorter';
import { RandomGenerator } from '../../../utils/RandomGenerator';
export const utilsModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
// array utils
bind<IArrayUtils>(ServiceIdentifiers.IArrayUtils)
.to(ArrayUtils)
.inSingletonScope();
// random generator
bind<IRandomGenerator>(ServiceIdentifiers.IRandomGenerator)
.to(RandomGenerator)
.inSingletonScope();
// crypt utils
bind<ICryptUtils>(ServiceIdentifiers.ICryptUtils)
.to(CryptUtils)
.inSingletonScope();
// crypt utils for string array
bind<ICryptUtilsStringArray>(ServiceIdentifiers.ICryptUtilsStringArray)
.to(CryptUtilsStringArray)
.inSingletonScope();
// escape sequence encoder
bind<IEscapeSequenceEncoder>(ServiceIdentifiers.IEscapeSequenceEncoder)
.to(EscapeSequenceEncoder)
.inSingletonScope();
// levelled topological sorter
bind<ILevelledTopologicalSorter>(ServiceIdentifiers.ILevelledTopologicalSorter)
.to(LevelledTopologicalSorter);
});