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

Function fromEnvRecord

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

Source from the content-addressed store, hash-verified

861 * @since 4.0.0
862 */
863export 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.

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