First non-blank value among `keys` (both casings are passed in by callers).
(env: Env, keys: readonly string[])
| 39 | |
| 40 | /** First non-blank value among `keys` (both casings are passed in by callers). */ |
| 41 | function firstNonBlank(env: Env, keys: readonly string[]): string | undefined { |
| 42 | for (const key of keys) { |
| 43 | const value = env[key]?.trim(); |
| 44 | if (value !== undefined && value.length > 0) return value; |
| 45 | } |
| 46 | return undefined; |
| 47 | } |
| 48 | |
| 49 | /** The value if it is an HTTP/HTTPS-scheme proxy (not SOCKS), else undefined. */ |
| 50 | function httpSchemeValue(value: string | undefined): string | undefined { |
no outgoing calls
no test coverage detected