From 8ad8e7a9fcc2d866f5684a3280262823b117e673 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 1 Feb 2022 18:21:27 -0500 Subject: [PATCH] Trim environment variables --- CHANGELOG.md | 2 ++ src/services/config.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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] = value; } else if (typeof value === 'string') { - this[key as ConditionalKeys] = value; + this[key as ConditionalKeys] = value.trim(); } else { throw new Error(`Unsupported type for ${key}`); }