Fixing an issue with env variables becoming numbers if they started with one.
This commit is contained in:
parent
582f9052d8
commit
7ae840f758
|
@ -74,9 +74,10 @@ module.exports = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert any strings to numbers if required, like "0" would be true otherwise
|
// clean up any environment variable edge cases
|
||||||
for (let [key, value] of Object.entries(module.exports)) {
|
for (let [key, value] of Object.entries(module.exports)) {
|
||||||
if (typeof value === "string" && !isNaN(parseInt(value))) {
|
// handle the edge case of "0" to disable an environment variable
|
||||||
module.exports[key] = parseInt(value)
|
if (value === "0") {
|
||||||
|
module.exports[key] = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,3 +52,11 @@ module.exports = {
|
||||||
return !isDev()
|
return !isDev()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up any environment variable edge cases
|
||||||
|
for (let [key, value] of Object.entries(module.exports)) {
|
||||||
|
// handle the edge case of "0" to disable an environment variable
|
||||||
|
if (value === "0") {
|
||||||
|
module.exports[key] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue