fix envOptions being impossible to disable if they defaul to on
This commit is contained in:
parent
c53bb126ef
commit
ed3dd81b4b
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue