(source: unknown)
| 59 | } |
| 60 | |
| 61 | function readList(source: unknown): Record<string, string[]> { |
| 62 | if (typeof source !== 'object' || source === null || Array.isArray(source)) { |
| 63 | return {}; |
| 64 | } |
| 65 | const out: Record<string, string[]> = {}; |
| 66 | for (const [key, value] of Object.entries(source as Record<string, unknown>)) { |
| 67 | if (Array.isArray(value)) { |
| 68 | out[key] = value.filter((entry): entry is string => typeof entry === 'string'); |
| 69 | } |
| 70 | } |
| 71 | return out; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * The record of one project, or an empty one. |