MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / expandEnv

Function expandEnv

src/mcp/config.ts:38–43  ·  view source on GitHub ↗

Expand ${VAR} and $VAR references in a string using process.env.

(value: string)

Source from the content-addressed store, hash-verified

36
37/** Expand ${VAR} and $VAR references in a string using process.env. */
38function expandEnv(value: string): string {
39 return value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}|\$([A-Za-z_][A-Za-z0-9_]*)/g, (_, braced, bare) => {
40 const name = braced ?? bare
41 return process.env[name] ?? ""
42 })
43}
44
45function isPlainObject(value: unknown): value is Record<string, unknown> {
46 return typeof value === "object" && value !== null && !Array.isArray(value)

Callers 1

normalizeServerConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected