Environment variable type coercion fix

This commit is contained in:
Rory Powell 2022-11-25 12:52:50 +00:00
parent 3a3cc523f8
commit 20c4b00a0c
1 changed files with 3 additions and 2 deletions

View File

@ -67,7 +67,8 @@ const env = {
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
_set(key: any, value: any) {
process.env[key] = value
module.exports[key] = value
// @ts-ignore
env[key] = value
},
isDev,
isTest,
@ -82,7 +83,7 @@ if (!env.APPS_URL) {
}
// clean up any environment variable edge cases
for (let [key, value] of Object.entries(module.exports)) {
for (let [key, value] of Object.entries(env)) {
// handle the edge case of "0" to disable an environment variable
if (value === "0") {
// @ts-ignore