@nestjs/config
Advanced tools
Comparing version 1.0.3 to 1.1.0
import { NoInferType, Path, PathValue } from './types'; | ||
/** | ||
* `ExcludeUndefinedIf<ExcludeUndefined, T> | ||
* | ||
* If `ExcludeUndefined` is `true`, remove `undefined` from `T`. | ||
* Otherwise, constructs the type `T` with `undefined`. | ||
*/ | ||
declare type ExcludeUndefinedIf<ExcludeUndefined extends boolean, T> = ExcludeUndefined extends true ? Exclude<T, undefined> : T | undefined; | ||
export interface ConfigGetOptions { | ||
@@ -10,3 +17,3 @@ /** | ||
} | ||
export declare class ConfigService<K = Record<string, unknown>> { | ||
export declare class ConfigService<K = Record<string, unknown>, WasValidated extends boolean = false> { | ||
private readonly internalConfig; | ||
@@ -23,3 +30,3 @@ private set isCacheEnabled(value); | ||
*/ | ||
get<T = any>(propertyPath: keyof K): T | undefined; | ||
get<T = any>(propertyPath: keyof K): ExcludeUndefinedIf<WasValidated, T>; | ||
/** | ||
@@ -31,3 +38,3 @@ * Get a configuration value (either custom configuration or process environment variable) | ||
*/ | ||
get<T = K, P extends Path<T> = any, R = PathValue<T, P>>(propertyPath: P, options: ConfigGetOptions): R | undefined; | ||
get<T = K, P extends Path<T> = any, R = PathValue<T, P>>(propertyPath: P, options: ConfigGetOptions): ExcludeUndefinedIf<WasValidated, R>; | ||
/** | ||
@@ -57,1 +64,2 @@ * Get a configuration value (either custom configuration or process environment variable) | ||
} | ||
export {}; |
{ | ||
"name": "@nestjs/config", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@config)", | ||
@@ -29,4 +29,4 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@commitlint/cli": "13.2.1", | ||
"@commitlint/config-angular": "13.2.0", | ||
"@commitlint/cli": "14.1.0", | ||
"@commitlint/config-angular": "14.1.0", | ||
"@nestjs/common": "8.1.2", | ||
@@ -42,4 +42,4 @@ "@nestjs/core": "8.1.2", | ||
"@types/uuid": "8.3.1", | ||
"@typescript-eslint/eslint-plugin": "5.2.0", | ||
"@typescript-eslint/parser": "5.2.0", | ||
"@typescript-eslint/eslint-plugin": "5.3.0", | ||
"@typescript-eslint/parser": "5.3.0", | ||
"eslint": "8.1.0", | ||
@@ -46,0 +46,0 @@ "eslint-config-prettier": "8.3.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
37918
694