(raw: unknown)
| 437 | } |
| 438 | |
| 439 | function readInterface(raw: unknown): PluginInterface | undefined { |
| 440 | if (!isObject(raw)) return undefined; |
| 441 | const out: PluginInterface = { |
| 442 | displayName: stringField(raw, 'displayName'), |
| 443 | shortDescription: stringField(raw, 'shortDescription'), |
| 444 | longDescription: stringField(raw, 'longDescription'), |
| 445 | developerName: stringField(raw, 'developerName'), |
| 446 | websiteURL: stringField(raw, 'websiteURL'), |
| 447 | }; |
| 448 | const hasAny = Object.values(out).some((value) => value !== undefined); |
| 449 | return hasAny ? out : undefined; |
| 450 | } |
| 451 | |
| 452 | function stringField(raw: Record<string, unknown>, key: string): string | undefined { |
| 453 | const value = raw[key]; |
no test coverage detected