aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2022-02-01 18:21:27 -0500
committerMax Isom <[email protected]>2022-02-01 18:22:46 -0500
commit8ad8e7a9fcc2d866f5684a3280262823b117e673 (patch)
tree756cafdc01289380eb7abf00c5e63c1c9ed61a9f
parentd0bb4fde27f4c44023845649d6e9ce6d09e66f24 (diff)
downloadmuse-8ad8e7a9fcc2d866f5684a3280262823b117e673.tar.xz
muse-8ad8e7a9fcc2d866f5684a3280262823b117e673.zip
Trim environment variables
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/services/config.ts2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b6c7eb..08ba887 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+### Changed
+- Environment variable values are now trimmed (whitespace is removed)
## [0.5.2] - 2022-01-29
### Fixed
diff --git a/src/services/config.ts b/src/services/config.ts
index e96e371..0720c2c 100644
--- a/src/services/config.ts
+++ b/src/services/config.ts
@@ -38,7 +38,7 @@ export default class Config {
if (typeof value === 'number') {
this[key as ConditionalKeys<typeof CONFIG_MAP, number>] = value;
} else if (typeof value === 'string') {
- this[key as ConditionalKeys<typeof CONFIG_MAP, string>] = value;
+ this[key as ConditionalKeys<typeof CONFIG_MAP, string>] = value.trim();
} else {
throw new Error(`Unsupported type for ${key}`);
}