Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(): do not assign a non-string to process.env
Assigning a value to process.env[] leads to stringification of the value. Example: ``` > process.env.test = {} > process.env.test '[object Object]' ``` This problem was hidden because `ConfigService.get` returns the value of the validated config which would not be stringified. A special case is when an environment variable has the value `undefined`. This is because `ConfigService.get` falls back to process.env which returns the stringified form `'undefined'`. The stringification is deprecated and might result in a runtime error in the future. See https://nodejs.org/api/process.html#processenv. The argument has been changed to Record<string, unknown> to be more type-safe. If this type was used in the original code, this bug could have been avoided.
- Loading branch information