(codec: Schema.Codec<T, E>, path?: string | ConfigProvider.Path)
| 640 | * |
| 641 | * const makeConfig = (config: Config.Wrap<Options>): Config.Config<Options> => |
| 642 | * Config.unwrap(config) |
| 643 | * |
| 644 | * const config = makeConfig({ key: Config.string("key") }) |
| 645 | * const provider = ConfigProvider.fromUnknown({ key: "value" }) |
| 646 | * Effect.runSync(config.parse(provider)) // => { key: "value" } |
| 647 | * ``` |
| 648 | * |
| 649 | * @see {@link Wrap} – the utility type accepted by this function |
| 650 | * |
| 651 | * @category converting |
| 652 | * @since 2.0.0 |
| 653 | */ |
| 654 | export const unwrap = <T>(wrapped: Wrap<T>): Config<T> => { |
| 655 | if (isConfig(wrapped)) return wrapped |
| 656 | return all(Rec.map(wrapped as Record<string, Wrap<any>>, (config) => unwrap(config))) as Config<T> |
| 657 | } |
| 658 | |
| 659 | // ----------------------------------------------------------------------------- |
| 660 | // schema |
| 661 | // ----------------------------------------------------------------------------- |
| 662 | |
| 663 | interface ConfigCursor { |
searching dependent graphs…