Package: effect
Module: Config
Constructs a Config<T> from a value matching Wrap<T>.
When to use
Use when accepting config from callers who may pass either a single Config or a
record of individual Configs.
Details
If the input is already a Config, it is returned as-is. Otherwise, each
key is recursively unwrapped and combined.
Example (Unwrapping a record of configs)
import { Config } from "effect"
interface Options {
key: string
}
const makeConfig = (config: Config.Wrap<Options>): Config.Config<Options> =>
Config.unwrap(config)
See
Wrap – the utility type accepted by this functionSignature
declare const unwrap: <T>(wrapped: Wrap<T>) => Config<T>
Since v2.0.0