MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromEnvRecord

Function fromEnvRecord

packages/effect/src/ConfigProvider.ts:882–889  ·  view source on GitHub ↗
(
  env: Record<string, string | undefined>,
  options?: { readonly preserveEmptyStrings?: boolean | undefined }
)

Source from the content-addressed store, hash-verified

880 * @since 4.0.0
881 */
882export function fromEnvRecord(
883 env: Record<string, string | undefined>,
884 options?: { readonly preserveEmptyStrings?: boolean | undefined }
885): ConfigProvider {
886 const preserveEmptyStrings = options?.preserveEmptyStrings === true
887 const trie = buildEnvTrie(env)
888 return make((path) => Effect.succeed(nodeAtEnv(trie, env, path, preserveEmptyStrings)))
889}
890
891/**
892 * Creates a `ConfigProvider` backed by environment variables.

Callers 2

fromEnvFunction · 0.85
fromDotEnvContentsFunction · 0.85

Calls 4

buildEnvTrieFunction · 0.85
nodeAtEnvFunction · 0.85
makeFunction · 0.70
succeedMethod · 0.45

Tested by

no test coverage detected