Function
parseBoolean
(value: string | undefined)
Source from the content-addressed store, hash-verified
| 46 | } |
| 47 | |
| 48 | function parseBoolean(value: string | undefined): boolean { |
| 49 | if (!value) { |
| 50 | return false; |
| 51 | } |
| 52 | const normalized = value.trim().toLowerCase(); |
| 53 | return ( |
| 54 | normalized === "1" || |
| 55 | normalized === "true" || |
| 56 | normalized === "yes" || |
| 57 | normalized === "on" |
| 58 | ); |
| 59 | } |
| 60 | |
| 61 | function readEnvValue(primary: string, legacy: string): string | undefined { |
| 62 | return process.env[primary] ?? process.env[legacy]; |
Tested by
no test coverage detected