mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Settings: Support null and undefined env var substitutions
This commit is contained in:
parent
299dbbe7e6
commit
c7bb18c6da
4 changed files with 65 additions and 10 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue