@nestjs/config
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -17,2 +17,3 @@ import { NoInferType, Path, PathValue } from './types'; | ||
} | ||
declare type KeyOf<T> = T extends unknown ? string : keyof T; | ||
export declare class ConfigService<K = Record<string, unknown>, WasValidated extends boolean = false> { | ||
@@ -30,3 +31,3 @@ private readonly internalConfig; | ||
*/ | ||
get<T = any>(propertyPath: keyof K): ExcludeUndefinedIf<WasValidated, T>; | ||
get<T = any>(propertyPath: KeyOf<K>): ExcludeUndefinedIf<WasValidated, T>; | ||
/** | ||
@@ -46,3 +47,3 @@ * Get a configuration value (either custom configuration or process environment variable) | ||
*/ | ||
get<T = any>(propertyPath: keyof K, defaultValue: NoInferType<T>): T; | ||
get<T = any>(propertyPath: KeyOf<K>, defaultValue: NoInferType<T>): T; | ||
/** | ||
@@ -49,0 +50,0 @@ * Get a configuration value (either custom configuration or process environment variable) |
@@ -1,1 +0,1 @@ | ||
export declare type NoInferType<T> = [T][T extends any ? 0 : never]; | ||
export declare type NoInferType<T> = T extends unknown ? any : [T][T extends any ? 0 : never]; |
export declare type PathImpl<T, Key extends keyof T> = Key extends string ? T[Key] extends Record<string, any> ? `${Key}.${PathImpl<T[Key], Exclude<keyof T[Key], keyof any[]>> & string}` | `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}` : never : never; | ||
export declare type PathImpl2<T> = PathImpl<T, keyof T> | keyof T; | ||
export declare type Path<T> = PathImpl2<T> extends string | keyof T ? PathImpl2<T> : keyof T; | ||
export declare type Path<T> = T extends unknown ? any : PathImpl2<T> extends string | keyof T ? PathImpl2<T> : keyof T; | ||
export declare type PathValue<T, P extends Path<T>> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? Rest extends Path<T[Key]> ? PathValue<T[Key], Rest> : never : never : P extends keyof T ? T[P] : never; |
{ | ||
"name": "@nestjs/config", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@config)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
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
38034
695