Hyperlinkv0.8.0-beta.28

Config

Config.Wraptypeeffect/Config.ts:438
Wrap<A>

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 }>

Wrapunwrap
Source effect/Config.ts:4385 lines
export 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>
Referenced by 4 symbols