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

Function dotEnvExpand

packages/effect/src/ConfigProvider.ts:1095–1104  ·  view source on GitHub ↗
(parsed: Record<string, string>)

Source from the content-addressed store, hash-verified

1093}
1094
1095function dotEnvExpand(parsed: Record<string, string>): Record<string, string> {
1096 const newParsed: Record<string, string> = Object.create(null)
1097
1098 for (const configKey of Object.keys(parsed)) {
1099 // resolve escape sequences
1100 newParsed[configKey] = interpolate(parsed[configKey], parsed).replace(/\\\$/g, "$")
1101 }
1102
1103 return newParsed
1104}
1105
1106function interpolate(envValue: string, parsed: Record<string, string>): string {
1107 // find the last unescaped dollar sign in the

Callers 1

fromDotEnvContentsFunction · 0.85

Calls 2

interpolateFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected