DefinitelyTyped/types/config/raw.d.ts
Eitan Levi b581c9f5d2 Fix the raw function in node-config. (#40086)
I submitted a patch previously that added the `raw` function but I
neglected to export the `RawConfig` class, which is what's actually
returned from that `raw` function. My apologies for not getting this
right the first time. Here is the implementation file that shows the
`RawConfig` class and its `resolve()` method: https://github.com/lorenwest/node-config/blob/master/raw.js
2019-11-07 11:24:42 -08:00

11 lines
429 B
TypeScript

/* The raw function returns an object as-is instead of passing it through processes that will make the object immutable.
* See: https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#using-promises-processstdout-and-other-objects-in-javascript-config-files
*/
export class RawConfig<T> {
constructor(rawObj: T);
resolve(): T;
}
export function raw<T>(obj: T): RawConfig<T>;