(value: unknown)
| 16 | * semantics at execution boundaries. |
| 17 | */ |
| 18 | export function normalizeStringRecord(value: unknown): StringRecord { |
| 19 | if (!isPlainRecord(value)) { |
| 20 | return {} |
| 21 | } |
| 22 | |
| 23 | const normalized: StringRecord = {} |
| 24 | for (const [key, entryValue] of Object.entries(value)) { |
| 25 | if (entryValue === undefined || entryValue === null) { |
| 26 | continue |
| 27 | } |
| 28 | normalized[key] = typeof entryValue === 'string' ? entryValue : String(entryValue) |
| 29 | } |
| 30 | return normalized |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Normalizes record-of-record maps such as block output schema maps. |
no test coverage detected