Package: effect
Module: Config
Utility type that recursively replaces primitives with Config in a nested
structure.
When to use
Use when typing the input of unwrap so callers can pass either a Config
or a record of Configs.
Details
Config.Wrap<{ key: string }> becomes { key: Config<string> } | Config<{ key: string }>
See
unwrap – construct a Config from a Wrap<T>Signature
type Wrap<A> = [NonNullable<A>] extends [infer T] ? [IsPlainObject<T>] extends [true] ?
| { readonly [K in keyof A]: Wrap<A[K]> }
| Config<A>
: Config<A>
: Config<A>
Since v2.0.0