fix: treat empty-string env vars as unset in getEnvValueSync (#396)

This commit is contained in:
Ben Senescu 2026-07-18 20:08:20 -04:00 committed by GitHub
parent 1398605ddc
commit 040282511a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ export function getEnvValueSync(
return processValue; return processValue;
} }
const value: unknown = Reflect.get(env, name); const value: unknown = Reflect.get(env, name);
return typeof value === "string" ? value : undefined; return typeof value === "string" && value !== "" ? value : undefined;
} }
export async function getRequiredEnvValue(name: string): Promise<string> { export async function getRequiredEnvValue(name: string): Promise<string> {