|
33 | 33 | */ |
34 | 34 | function isIsolationMessage(event) { |
35 | 35 | if ( |
36 | | - typeof event.data === 'object' && |
37 | | - typeof event.data.payload === 'object' |
| 36 | + typeof event.data === 'object' |
| 37 | + && typeof event.data.payload === 'object' |
38 | 38 | ) { |
39 | 39 | const keys = Object.keys(event.data.payload || {}) |
40 | 40 | return ( |
41 | | - keys.length > 0 && |
42 | | - keys.every( |
| 41 | + keys.length > 0 |
| 42 | + && keys.every( |
43 | 43 | (key) => key === 'contentType' || key === 'nonce' || key === 'payload' |
44 | 44 | ) |
45 | 45 | ) |
|
55 | 55 | */ |
56 | 56 | function isIsolationPayload(data) { |
57 | 57 | return ( |
58 | | - typeof data === 'object' && |
59 | | - 'callback' in data && |
60 | | - 'error' in data && |
61 | | - !isIsolationMessage(data) |
| 58 | + typeof data === 'object' |
| 59 | + && 'callback' in data |
| 60 | + && 'error' in data |
| 61 | + && !isIsolationMessage(data) |
62 | 62 | ) |
63 | 63 | } |
64 | 64 |
|
|
99 | 99 | const SERIALIZE_TO_IPC_FN = '__TAURI_TO_IPC_KEY__' |
100 | 100 |
|
101 | 101 | if ( |
102 | | - typeof data === 'object' && |
103 | | - data !== null && |
104 | | - 'constructor' in data && |
105 | | - data.constructor === Array |
| 102 | + typeof data === 'object' |
| 103 | + && data !== null |
| 104 | + && 'constructor' in data |
| 105 | + && data.constructor === Array |
106 | 106 | ) { |
107 | 107 | return data.map((v) => serializeIpcPayload(v)) |
108 | 108 | } |
109 | 109 |
|
110 | 110 | if ( |
111 | | - typeof data === 'object' && |
112 | | - data !== null && |
113 | | - SERIALIZE_TO_IPC_FN in data |
| 111 | + typeof data === 'object' |
| 112 | + && data !== null |
| 113 | + && SERIALIZE_TO_IPC_FN in data |
114 | 114 | ) { |
115 | 115 | return data[SERIALIZE_TO_IPC_FN]() |
116 | 116 | } |
117 | 117 |
|
118 | 118 | if ( |
119 | | - typeof data === 'object' && |
120 | | - data !== null && |
121 | | - 'constructor' in data && |
122 | | - data.constructor === Object |
| 119 | + typeof data === 'object' |
| 120 | + && data !== null |
| 121 | + && 'constructor' in data |
| 122 | + && data.constructor === Object |
123 | 123 | ) { |
124 | 124 | const acc = {} |
125 | 125 | Object.entries(data).forEach(([k, v]) => { |
|
0 commit comments