(record: Record<string, unknown>, key: string)
| 356 | } |
| 357 | |
| 358 | function requiredString(record: Record<string, unknown>, key: string): string { |
| 359 | const value = record[key]; |
| 360 | if (typeof value !== 'string' || value.length === 0) { |
| 361 | throw new Error(`Expected ${key} to be a non-empty string.`); |
| 362 | } |
| 363 | return value; |
| 364 | } |
| 365 | |
| 366 | function optionalString(record: Record<string, unknown>, key: string): string | undefined { |
| 367 | const value = record[key]; |
no outgoing calls
no test coverage detected
searching dependent graphs…