( path: string, base: NodeJS.ProcessEnv = process.env, )
| 23 | * attempt to scope PATH. We strip every case-variant first, then set PATH. |
| 24 | */ |
| 25 | export function envWithPath( |
| 26 | path: string, |
| 27 | base: NodeJS.ProcessEnv = process.env, |
| 28 | ): NodeJS.ProcessEnv { |
| 29 | const next: NodeJS.ProcessEnv = {}; |
| 30 | for (const [key, value] of Object.entries(base)) { |
| 31 | if (key.toLowerCase() !== "path") { |
| 32 | next[key] = value; |
| 33 | } |
| 34 | } |
| 35 | next.PATH = path; |
| 36 | return next; |
| 37 | } |
no outgoing calls
no test coverage detected