|
1 | 1 | import * as types from '../constants/ActionTypes'; |
2 | 2 |
|
3 | 3 | export const updateCode = (code) => ({ |
4 | | - 'type': types.UPDATE_CODE, |
5 | | - code |
| 4 | + 'type': types.UPDATE_CODE, |
| 5 | + code |
6 | 6 | }); |
7 | 7 |
|
8 | 8 | export const obfuscateCode = (code, options) => { |
9 | 9 |
|
10 | | - const body = { |
11 | | - code, |
12 | | - options |
13 | | - }; |
| 10 | + const body = { |
| 11 | + code, |
| 12 | + options |
| 13 | + }; |
14 | 14 |
|
15 | | - const request = new Request('/obfuscate', { |
16 | | - method: 'POST', |
17 | | - credentials: 'same-origin', |
18 | | - headers: { |
19 | | - 'Accept': 'application/json', |
20 | | - 'Content-Type': 'application/json' |
21 | | - }, |
22 | | - body: JSON.stringify(body), |
23 | | - }); |
| 15 | + const request = new Request('/obfuscate', { |
| 16 | + method: 'POST', |
| 17 | + credentials: 'same-origin', |
| 18 | + headers: { |
| 19 | + 'Accept': 'application/json', |
| 20 | + 'Content-Type': 'application/json' |
| 21 | + }, |
| 22 | + body: JSON.stringify(body), |
| 23 | + }); |
24 | 24 |
|
25 | | - return { |
26 | | - type: types.OBFUSCATE, |
27 | | - payload: fetch(request).then((response) => response.json()), |
28 | | - } |
| 25 | + return { |
| 26 | + type: types.OBFUSCATE, |
| 27 | + payload: fetch(request).then((response) => response.json()), |
| 28 | + } |
29 | 29 |
|
30 | | -} |
| 30 | +}; |
31 | 31 |
|
32 | 32 | export const toggleOption = (optionType) => ({ |
33 | | - 'type': optionType |
| 33 | + 'type': optionType |
34 | 34 | }); |
35 | 35 |
|
36 | 36 | export const addDomainLock = (domain) => ({ |
37 | | - 'type': types.ADD_DOMAIN_LOCK, |
38 | | - domain |
| 37 | + 'type': types.ADD_DOMAIN_LOCK, |
| 38 | + domain |
39 | 39 | }); |
40 | 40 |
|
41 | 41 | export const removeDomainLock = (domain) => ({ |
42 | | - 'type': types.REMOVE_DOMAIN_LOCK, |
43 | | - domain |
| 42 | + 'type': types.REMOVE_DOMAIN_LOCK, |
| 43 | + domain |
44 | 44 | }); |
45 | 45 |
|
46 | 46 | export const addReservedName = (name) => ({ |
47 | | - 'type': types.ADD_RESERVED_NAME, |
48 | | - name |
| 47 | + 'type': types.ADD_RESERVED_NAME, |
| 48 | + name |
49 | 49 | }); |
50 | 50 |
|
51 | 51 | export const removeReservedName = (name) => ({ |
52 | | - 'type': types.REMOVE_RESERVED_NAME, |
53 | | - name |
| 52 | + 'type': types.REMOVE_RESERVED_NAME, |
| 53 | + name |
54 | 54 | }); |
55 | 55 |
|
56 | 56 | export const setStringArrayThreshold = (threshold) => ({ |
57 | | - 'type': types.SET_STRING_ARRAY_THRESHOLD, |
58 | | - threshold |
| 57 | + 'type': types.SET_STRING_ARRAY_THRESHOLD, |
| 58 | + threshold |
59 | 59 | }); |
60 | 60 |
|
61 | 61 | export const setStringArrayEncoding = (encoding) => ({ |
62 | | - 'type': types.SET_STRING_ARRAY_ENCODING, |
63 | | - encoding |
| 62 | + 'type': types.SET_STRING_ARRAY_ENCODING, |
| 63 | + encoding |
64 | 64 | }); |
65 | 65 |
|
66 | 66 | export const setSourceMapMode = (mode) => ({ |
67 | | - 'type': types.SET_SOURCEMAP_MODE, |
68 | | - mode |
| 67 | + 'type': types.SET_SOURCEMAP_MODE, |
| 68 | + mode |
69 | 69 | }); |
70 | 70 |
|
71 | 71 | export const setSourceMapBaseUrl = (baseUrl) => ({ |
72 | | - 'type': types.SET_SOURCEMAP_BASE_URL, |
73 | | - baseUrl |
| 72 | + 'type': types.SET_SOURCEMAP_BASE_URL, |
| 73 | + baseUrl |
74 | 74 | }); |
75 | 75 |
|
76 | 76 | export const setSourceMapFileName = (fileName) => ({ |
77 | | - 'type': types.SET_SOURCEMAP_FILE_NAME, |
78 | | - fileName |
| 77 | + 'type': types.SET_SOURCEMAP_FILE_NAME, |
| 78 | + fileName |
79 | 79 | }); |
80 | 80 |
|
81 | 81 | export const setSeed = (seed) => ({ |
82 | | - 'type': types.SET_SEED, |
83 | | - seed |
| 82 | + 'type': types.SET_SEED, |
| 83 | + seed |
84 | 84 | }); |
85 | 85 |
|
86 | 86 | export const setControlFlowFlatteningThreshold = (threshold) => ({ |
87 | | - 'type': types.SET_CONTROL_FLOW_FLATTENING_THRESHOLD, |
88 | | - threshold |
| 87 | + 'type': types.SET_CONTROL_FLOW_FLATTENING_THRESHOLD, |
| 88 | + threshold |
89 | 89 | }); |
90 | 90 |
|
91 | 91 | export const setDeadCodeInjectionThreshold = (threshold) => ({ |
92 | | - 'type': types.SET_DEAD_CODE_INJECTION_THRESHOLD, |
93 | | - threshold |
| 92 | + 'type': types.SET_DEAD_CODE_INJECTION_THRESHOLD, |
| 93 | + threshold |
94 | 94 | }); |
95 | 95 |
|
96 | 96 | export const setTarget = (target) => ({ |
97 | | - 'type': types.SET_TARGET, |
98 | | - target |
| 97 | + 'type': types.SET_TARGET, |
| 98 | + target |
99 | 99 | }); |
100 | 100 |
|
101 | 101 | export const setIdentifierNamesGenerator = (identifierNamesGenerator) => ({ |
102 | | - 'type': types.SET_IDENTIFIER_NAMES_GENERATOR, |
103 | | - identifierNamesGenerator |
| 102 | + 'type': types.SET_IDENTIFIER_NAMES_GENERATOR, |
| 103 | + identifierNamesGenerator |
104 | 104 | }); |
105 | 105 |
|
106 | 106 | export const setIdentifiersPrefix = (identifiersPrefix) => ({ |
107 | | - 'type': types.SET_IDENTIFIERS_PREFIX, |
108 | | - identifiersPrefix |
| 107 | + 'type': types.SET_IDENTIFIERS_PREFIX, |
| 108 | + identifiersPrefix |
109 | 109 | }); |
0 commit comments