MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / parseEnvExample

Function parseEnvExample

ts/workflow-cli/cli/deploy/components.ts:114–119  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

112type EnvEntry = { kind: "kv"; key: string; value: string } | { kind: "comment"; text: string };
113
114export function parseEnvExample(text: string): EnvEntry[] {
115 return text.split("\n").map((line) => {
116 const m = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
117 return m ? { kind: "kv", key: m[1] ?? "", value: m[2] ?? "" } : { kind: "comment", text: line };
118 });
119}
120
121// Keys whose value is likely a secret — masked when prompted, never echoed.
122const SECRET_HINT = /password|secret|key|token/i;

Callers 2

components.test.tsFile · 0.90
resolveComponentEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected