(text: string)
| 112 | type EnvEntry = { kind: "kv"; key: string; value: string } | { kind: "comment"; text: string }; |
| 113 | |
| 114 | export 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. |
| 122 | const SECRET_HINT = /password|secret|key|token/i; |
no outgoing calls
no test coverage detected