-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObfuscatorStrategyMap.js
More file actions
32 lines (29 loc) · 1.36 KB
/
Copy pathObfuscatorStrategyMap.js
File metadata and controls
32 lines (29 loc) · 1.36 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
import { StringObfuscatorStrategy } from "./StringObfuscatorStrategy.js";
import { XORObfuscatorStrategy } from "./XORObfuscatorStrategy.js";
import { NoObfuscatorStrategy } from "./NoObfuscatorStrategy.js";
import { DictionaryObfuscatorStrategy } from "./DictionaryObfuscatorStrategy.js";
import { HTMLObfuscatorStrategy } from "./HTMLObfuscatorStrategy.js";
import { LinkObfuscatorStrategy } from "./LinkObfuscatorStrategy.js";
/**
* This is the central index of all obfuscator strategies.
*/
// One dictionary shared between the column path and the HTML path, so a column value and its
// copy inside document HTML get the same replacement and the app can still match them.
const dictionaryObfuscatorStrategy = new DictionaryObfuscatorStrategy();
// One link obfuscator for the column path and the HTML path, so both copies of a link come out
// with the same value.
const linkObfuscatorStrategy = new LinkObfuscatorStrategy(
dictionaryObfuscatorStrategy,
);
const ObfuscatorStrategyMap = {
stringObfuscator: new StringObfuscatorStrategy(),
xorObfuscator: new XORObfuscatorStrategy(),
dictionaryObfuscator: dictionaryObfuscatorStrategy,
noObfuscator: new NoObfuscatorStrategy(),
htmlObfuscator: new HTMLObfuscatorStrategy(
dictionaryObfuscatorStrategy,
linkObfuscatorStrategy,
),
linkObfuscator: linkObfuscatorStrategy,
};
export default ObfuscatorStrategyMap;