@nestjs/config
Version:
Configuration for NestJS: load .env files and custom configuration, validate it at startup, and read it through an injectable ConfigService.
27 lines (26 loc) • 1.23 kB
TypeScript
export declare const hasOwn: (target: object, key: PropertyKey) => boolean;
/**
* Returns the first key of a property path (e.g. "database" for
* "database.host"), or the path itself if "object" has it as a key.
*/
export declare function getRootKey(object: unknown, path: PropertyKey): PropertyKey;
/**
* Resolves a property path (e.g. "database.host") against "object".
* Members inherited from built-in prototypes resolve to `undefined`.
*/
export declare function getProperty(object: unknown, path: PropertyKey): unknown;
/**
* Resolves a property path (e.g. "database.host") against "object". "found"
* tells a path whose value is `undefined` from one that doesn't exist.
*/
export declare function resolveProperty(object: unknown, path: PropertyKey): {
found: boolean;
value: unknown;
};
/**
* Sets the value at a property path (e.g. "database.host") of "object",
* creating the missing objects on the way. Only own properties are descended
* into, so the write can't land on a built-in shared by the whole process.
* Paths through "__proto__", "constructor" or "prototype" are ignored.
*/
export declare function setProperty(object: Record<PropertyKey, any>, path: PropertyKey, value: unknown): void;