@nestjs/config
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -28,2 +28,3 @@ import { DynamicModule } from '@nestjs/common'; | ||
private static loadEnvFile; | ||
private static assignVariablesToProcess; | ||
} |
@@ -20,2 +20,3 @@ "use strict"; | ||
const fs = __importStar(require("fs")); | ||
const util_1 = require("util"); | ||
const config_host_module_1 = require("./config-host.module"); | ||
@@ -36,3 +37,3 @@ const config_constants_1 = require("./config.constants"); | ||
if (options.envFilePath) { | ||
Object.assign(process.env, validatedConfig); | ||
this.assignVariablesToProcess(validatedConfig); | ||
} | ||
@@ -43,3 +44,3 @@ } | ||
if (options.envFilePath) { | ||
Object.assign(process.env, config); | ||
this.assignVariablesToProcess(config); | ||
} | ||
@@ -110,2 +111,9 @@ } | ||
} | ||
static assignVariablesToProcess(config) { | ||
if (!util_1.isObject(config)) { | ||
return; | ||
} | ||
const keys = Object.keys(config).filter(key => !(key in process.env)); | ||
keys.forEach(key => (process.env[key] = config[key])); | ||
} | ||
}; | ||
@@ -112,0 +120,0 @@ ConfigModule = ConfigModule_1 = __decorate([ |
{ | ||
"name": "@nestjs/config", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@config)", | ||
@@ -22,6 +22,6 @@ "author": "Kamil Mysliwiec", | ||
"@hapi/joi": "16.1.8", | ||
"@nestjs/common": "6.10.8", | ||
"@nestjs/core": "6.10.8", | ||
"@nestjs/platform-express": "6.10.8", | ||
"@nestjs/testing": "6.10.8", | ||
"@nestjs/common": "6.10.9", | ||
"@nestjs/core": "6.10.9", | ||
"@nestjs/platform-express": "6.10.9", | ||
"@nestjs/testing": "6.10.9", | ||
"@types/dotenv": "8.2.0", | ||
@@ -28,0 +28,0 @@ "@types/hapi__joi": "16.0.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18337
321