Trim environment variables

This commit is contained in:
Max Isom 2022-02-01 18:21:27 -05:00
parent d0bb4fde27
commit 8ad8e7a9fc
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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}`);
}