(record: Record<string, unknown>, key: string)
| 23 | } |
| 24 | |
| 25 | function stringValue(record: Record<string, unknown>, key: string): string { |
| 26 | const value = record[key] |
| 27 | if (typeof value !== "string" || !value) throw new Error(`${key} is required`) |
| 28 | return value |
| 29 | } |
| 30 | |
| 31 | function boolValue(value: unknown, fallback = false): boolean { |
| 32 | return typeof value === "boolean" ? value : fallback |
no outgoing calls
no test coverage detected