Function
getEnvVar
(env: unknown, varName: keyof T)
Source from the content-addressed store, hash-verified
| 19 | } |
| 20 | |
| 21 | function getEnvVar<T extends Record<string, unknown>>(env: unknown, varName: keyof T): string | undefined { |
| 22 | return typeof env === 'object' && env !== null && varName in env && typeof (env as T)[varName] === 'string' |
| 23 | ? ((env as T)[varName] as string) |
| 24 | : undefined; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Merges the options passed in from the user with the options we read from |
Tested by
no test coverage detected