(options?: {
readonly env?: Record<string, string> | undefined
readonly preserveEmptyStrings?: boolean | undefined
})
| 923 | * @since 2.0.0 |
| 924 | */ |
| 925 | export function fromEnv(options?: { |
| 926 | readonly env?: Record<string, string> | undefined |
| 927 | readonly preserveEmptyStrings?: boolean | undefined |
| 928 | }): ConfigProvider { |
| 929 | const env: Record<string, string | undefined> = options?.env ?? { |
| 930 | ...(globalThis as { |
| 931 | readonly process?: { readonly env?: Record<string, string | undefined> } |
| 932 | }).process?.env, |
| 933 | ...(import.meta as any)?.env |
| 934 | } |
| 935 | return fromEnvRecord(env, { preserveEmptyStrings: options?.preserveEmptyStrings }) |
| 936 | } |
| 937 | |
| 938 | type EnvTrieNode = { |
| 939 | children?: Record<string, EnvTrieNode> |
no test coverage detected