mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 10:48:12 +02:00
fix: parseBooleanFromEnv silently treats common truthy values as false
This commit is contained in:
1 parent
82d97418b2
commit
08ac2bc9a7
1 file changed
+4
-1
@@ -76,7 +76,10 @@ const ONBOARD_ENV_KEYS = [
|
||||
|
||||
function parseBooleanFromEnv(rawValue: string | undefined): boolean | 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 {
|
||||
|
||||
Reference in new issue
Block a user