(trie: EnvTrieNode, env: Record<string, string | undefined>, path: Path)
| 858 | * @see {@link fromEnv} – automatically reads the runtime environment |
| 859 | * |
| 860 | * @category constructors |
| 861 | * @since 4.0.0 |
| 862 | */ |
| 863 | export function fromEnvRecord( |
| 864 | env: Record<string, string | undefined>, |
| 865 | options?: { readonly preserveEmptyStrings?: boolean | undefined } |
| 866 | ): ConfigProvider { |
| 867 | const preserveEmptyStrings = options?.preserveEmptyStrings === true |
| 868 | const trie = buildEnvTrie(env) |
| 869 | return make((path) => Effect.succeed(nodeAtEnv(trie, env, path, preserveEmptyStrings))) |
| 870 | } |
| 871 | |
| 872 | /** |
| 873 | * Creates a `ConfigProvider` backed by environment variables. |
| 874 | * |
| 875 | * **When to use** |
| 876 | * |
| 877 | * Use to read configuration from `process.env`, which is the default when no |
| 878 | * provider is explicitly set, or pass a custom env record for testing. |
| 879 | * |
| 880 | * **Details** |
| 881 | * |
no test coverage detected
searching dependent graphs…