fix: parseBooleanFromEnv silently treats common truthy values as false
This commit is contained in:
parent
82d97418b2
commit
08ac2bc9a7
1 changed files with 4 additions and 1 deletions
|
|
@ -76,7 +76,10 @@ const ONBOARD_ENV_KEYS = [
|
||||||
|
|
||||||
function parseBooleanFromEnv(rawValue: string | undefined): boolean | null {
|
function parseBooleanFromEnv(rawValue: string | undefined): boolean | null {
|
||||||
if (rawValue === undefined) return null;
|
if (rawValue === undefined) return null;
|
||||||
return rawValue === "true";
|
const lower = rawValue.trim().toLowerCase();
|
||||||
|
if (lower === "true" || lower === "1" || lower === "yes") return true;
|
||||||
|
if (lower === "false" || lower === "0" || lower === "no") return false;
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseNumberFromEnv(rawValue: string | undefined): number | null {
|
function parseNumberFromEnv(rawValue: string | undefined): number | null {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue