MCPcopy Create free account
hub / github.com/effect-app/libs / nodeAtEnv

Function nodeAtEnv

repos/effect/packages/effect/src/ConfigProvider.ts:860–878  ·  view source on GitHub ↗
(trie: EnvTrieNode, env: Record<string, string | undefined>, path: Path)

Source from the content-addressed store, hash-verified

858 * @see {@link fromEnv} – automatically reads the runtime environment
859 *
860 * @category constructors
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.
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 *

Callers 1

fromEnvFunction · 0.85

Calls 6

trieNodeAtFunction · 0.85
makeValueFunction · 0.85
makeArrayFunction · 0.85
makeRecordFunction · 0.85
joinMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…