(value: unknown)
| 34 | * Normalizes record-of-record maps such as block output schema maps. |
| 35 | */ |
| 36 | export function normalizeRecordMap(value: unknown): Record<string, UnknownRecord> { |
| 37 | if (!isPlainRecord(value)) { |
| 38 | return {} |
| 39 | } |
| 40 | |
| 41 | const normalized: Record<string, UnknownRecord> = {} |
| 42 | for (const [key, entryValue] of Object.entries(value)) { |
| 43 | if (isPlainRecord(entryValue)) { |
| 44 | normalized[key] = entryValue |
| 45 | } |
| 46 | } |
| 47 | return normalized |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Workflow variables are stored as a record in current state, while some |
no test coverage detected