| 156 | } |
| 157 | |
| 158 | function getScriptData(script, syncVersion, extra) { |
| 159 | let data; |
| 160 | if (syncVersion === 2) { |
| 161 | data = { |
| 162 | version: syncVersion, |
| 163 | custom: script.custom, |
| 164 | config: script.config, |
| 165 | props: objectPick(script.props, ['lastUpdated']), |
| 166 | }; |
| 167 | } else if (syncVersion === 1) { |
| 168 | data = { |
| 169 | version: syncVersion, |
| 170 | more: { |
| 171 | custom: script.custom, |
| 172 | enabled: script.config.enabled, |
| 173 | update: script.config.shouldUpdate, |
| 174 | lastUpdated: script.props.lastUpdated, |
| 175 | }, |
| 176 | }; |
| 177 | } |
| 178 | return Object.assign(data, extra); |
| 179 | } |
| 180 | function parseScriptData(raw) { |
| 181 | const data = {}; |
| 182 | try { |