fix envOptions being impossible to disable if they defaul to on

This commit is contained in:
Hazelnoot 2025-11-02 10:28:45 -05:00
parent c53bb126ef
commit ed3dd81b4b

View file

@ -50,7 +50,8 @@ export function createEnvOptions(getEnv: () => Partial<Record<string, string>>):
const env = getEnv();
const envKey = translateKey(key);
if (envKey in env) {
return !!env[envKey];
const envValue = env[envKey]?.toLowerCase();
return !!envValue && envValue !== '0' && envValue !== 'false';
}
const def = env.NODE_ENV === 'test' ? testEnvOption : defaultEnvOption;