zod-config
Version:
Load configuration variables from multiple sources with flexible adapters, ensuring type safety with Zod.
17 lines (14 loc) • 638 B
TypeScript
import { C as Config } from './types-4fcc40ec.js';
export { A as Adapter, L as Logger } from './types-4fcc40ec.js';
import { AnyZodObject, z } from 'zod';
/**
* Load config from adapters.
*
* - If no adapters are provided, we will read from process.env.
* - If multiple adapters are provided, we will deep merge the data from all adapters, with the last adapter taking precedence.
* - If any adapter fails, we will still return the data from other adapters.
* @param config
* @returns parsed config
*/
declare const loadConfig: <T extends AnyZodObject>(config: Config<T>) => Promise<z.TypeOf<T>>;
export { Config, loadConfig };