(opencodeConfig: Config.Info, arcticConfig: Config.Info, field: keyof Config.Info)
| 197 | } |
| 198 | |
| 199 | function shouldImportField(opencodeConfig: Config.Info, arcticConfig: Config.Info, field: keyof Config.Info): boolean { |
| 200 | const opencodeValue = opencodeConfig[field] |
| 201 | const arcticValue = arcticConfig[field] |
| 202 | |
| 203 | if (!opencodeValue) return false |
| 204 | |
| 205 | if (Array.isArray(opencodeValue)) { |
| 206 | const arctArr = (arcticValue as any[]) || [] |
| 207 | return hasNewArrayContent(opencodeValue, arctArr) |
| 208 | } |
| 209 | |
| 210 | if (typeof opencodeValue === "object") { |
| 211 | const arctObj = (arcticValue as Record<string, any>) || {} |
| 212 | return hasNewObjectKeys(opencodeValue as Record<string, any>, arctObj) |
| 213 | } |
| 214 | |
| 215 | return !arcticValue |
| 216 | } |
| 217 | |
| 218 | function findImportableFields(opencodeConfig: Config.Info, arcticConfig: Config.Info): string[] { |
| 219 | return IMPORTABLE_CONFIG_FIELDS.filter((field) => shouldImportField(opencodeConfig, arcticConfig, field)) |
no test coverage detected