diff --git a/lib/config.module.ts b/lib/config.module.ts index b912d101..45437970 100644 --- a/lib/config.module.ts +++ b/lib/config.module.ts @@ -192,13 +192,18 @@ export class ConfigModule { return config; } - private static assignVariablesToProcess(config: Record) { + private static assignVariablesToProcess(config: Record) { if (!isObject(config)) { return; } const keys = Object.keys(config).filter(key => !(key in process.env)); keys.forEach( - key => (process.env[key] = (config as Record)[key]), + key => { + const value = config[key]; + if (typeof value === 'string') { + process.env[key] = value; + } + }, ); }