Function
stringArrayField
(raw: Record<string, unknown>, key: string)
Source from the content-addressed store, hash-verified
| 457 | } |
| 458 | |
| 459 | function stringArrayField(raw: Record<string, unknown>, key: string): readonly string[] | undefined { |
| 460 | const value = raw[key]; |
| 461 | if (!Array.isArray(value) || !value.every((entry) => typeof entry === 'string')) { |
| 462 | return undefined; |
| 463 | } |
| 464 | return value as readonly string[]; |
| 465 | } |
| 466 | |
| 467 | function isObject(value: unknown): value is Record<string, unknown> { |
| 468 | return typeof value === 'object' && value !== null && !Array.isArray(value); |
Tested by
no test coverage detected