From 7969c6a113b73c026827dda4169354770138f881 Mon Sep 17 00:00:00 2001 From: Mat Weaver Date: Thu, 19 Jan 2023 23:58:17 -0500 Subject: [PATCH] Update config.js Fixed issue when processing boolean environment variables. --- lib/config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index f27e641a..fb0df4fe 100644 --- a/lib/config.js +++ b/lib/config.js @@ -103,7 +103,14 @@ function walkConfig (level) { ); } - level[configEntry] = process.env[level[configEntry].ENV]; + let processingVariable = process.env[level[configEntry].ENV]; + if (processingVariable.toLowerCase() === 'true') { + processingVariable = true; + } + if (processingVariable.toLowerCase() === 'false') { + processingVariable = false; + } + level[configEntry] = processingVariable; } else if (level[configEntry] && typeof level[configEntry] === 'object') { level[configEntry] = walkConfig(level[configEntry]); }