@nestjs/config
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -32,3 +32,6 @@ "use strict"; | ||
if (options.validationSchema) { | ||
const config = this.loadEnvFile(options); | ||
let config = this.loadEnvFile(options); | ||
if (!options.ignoreEnvVars) { | ||
config = Object.assign(Object.assign({}, process.env), config); | ||
} | ||
const validationOptions = this.getSchemaValidationOptions(options); | ||
@@ -124,6 +127,12 @@ const { error, value: validatedConfig, } = options.validationSchema.validate(config, validationOptions); | ||
static getSchemaValidationOptions(options) { | ||
return (options.validationOptions || { | ||
if (options.validationOptions) { | ||
if (typeof options.validationOptions.allowUnknown === 'undefined') { | ||
options.validationOptions.allowUnknown = true; | ||
} | ||
return options.validationOptions; | ||
} | ||
return { | ||
abortEarly: false, | ||
allowUnknown: true, | ||
}); | ||
}; | ||
} | ||
@@ -130,0 +139,0 @@ }; |
export declare class ConfigService { | ||
private readonly internalConfig; | ||
constructor(internalConfig?: Record<string, any>); | ||
get<T = any>(propertyPath: string, defaultValue?: T): T | undefined; | ||
get<T = any>(propertyPath: string): T | undefined; | ||
get<T = any>(propertyPath: string, defaultValue: T): T; | ||
} |
@@ -5,2 +5,3 @@ import { ConfigFactory } from './config-factory.interface'; | ||
ignoreEnvFile?: boolean; | ||
ignoreEnvVars?: boolean; | ||
envFilePath?: string; | ||
@@ -7,0 +8,0 @@ encoding?: string; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_set_1 = __importDefault(require("lodash.set")); | ||
function mergeConfigObject(host, partial, token) { | ||
if (token) { | ||
return (host[token] = partial); | ||
lodash_set_1.default(host, token, partial); | ||
return partial; | ||
} | ||
@@ -7,0 +12,0 @@ Object.assign(host, partial); |
{ | ||
"name": "@nestjs/config", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@config)", | ||
@@ -19,10 +19,11 @@ "author": "Kamil Mysliwiec", | ||
"lodash.get": "4.4.2", | ||
"lodash.set": "4.3.2", | ||
"uuid": "3.3.3" | ||
}, | ||
"devDependencies": { | ||
"@hapi/joi": "16.1.8", | ||
"@nestjs/common": "6.10.13", | ||
"@nestjs/core": "6.10.13", | ||
"@nestjs/platform-express": "6.10.13", | ||
"@nestjs/testing": "6.10.13", | ||
"@hapi/joi": "17.0.0", | ||
"@nestjs/common": "6.10.14", | ||
"@nestjs/core": "6.10.14", | ||
"@nestjs/platform-express": "6.10.14", | ||
"@nestjs/testing": "6.10.14", | ||
"@types/dotenv": "8.2.0", | ||
@@ -32,5 +33,6 @@ "@types/hapi__joi": "16.0.6", | ||
"@types/lodash.get": "4.4.6", | ||
"@types/lodash.set": "4.3.6", | ||
"@types/node": "7.10.8", | ||
"@types/uuid": "3.4.6", | ||
"husky": "3.1.0", | ||
"husky": "4.0.0", | ||
"jest": "24.9.0", | ||
@@ -42,3 +44,3 @@ "lint-staged": "9.5.0", | ||
"rxjs": "6.5.4", | ||
"ts-jest": "24.2.0", | ||
"ts-jest": "24.3.0", | ||
"typescript": "3.7.4" | ||
@@ -45,0 +47,0 @@ }, |
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
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
21026
365
7
21
5
+ Addedlodash.set@4.3.2
+ Addedlodash.set@4.3.2(transitive)