Settings: Support null and undefined env var substitutions

This commit is contained in:
Richard Hansen 2021-06-06 02:14:50 -04:00
parent 299dbbe7e6
commit c7bb18c6da
4 changed files with 65 additions and 10 deletions

View file

@ -509,17 +509,13 @@ const coerceValue = (stringValue) => {
return +stringValue;
}
// the boolean literal case is easy.
if (stringValue === 'true') {
return true;
switch (stringValue) {
case 'true': return true;
case 'false': return false;
case 'undefined': return undefined;
case 'null': return null;
default: return stringValue;
}
if (stringValue === 'false') {
return false;
}
// otherwise, return this value as-is
return stringValue;
};
/**