( source: Record<string, unknown>, key: string, fallback: string | null, )
| 17 | } |
| 18 | |
| 19 | export function readNullableString( |
| 20 | source: Record<string, unknown>, |
| 21 | key: string, |
| 22 | fallback: string | null, |
| 23 | ): string | null { |
| 24 | const value = source[key] |
| 25 | |
| 26 | if (typeof value === 'string' || value === null) { |
| 27 | return value |
| 28 | } |
| 29 | |
| 30 | return fallback |
| 31 | } |
| 32 | |
| 33 | export function readNumber( |
| 34 | source: Record<string, unknown>, |
no outgoing calls
no test coverage detected