zod-config
Version:
Load configuration variables from multiple sources with flexible adapters, ensuring type safety with Zod.
18 lines (15 loc) • 692 B
TypeScript
import { S as SchemaConfig, C as Config, I as InferredDataConfig } from './types-0bb1a3ce.js';
export { A as Adapter, L as Logger } from './types-0bb1a3ce.js';
import 'zod/v3';
import 'zod/v4/core';
/**
* 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 SchemaConfig>(config: Config<T>) => Promise<InferredDataConfig<T>>;
export { Config, loadConfig };