(env: NodeJS.ProcessEnv)
| 449 | } |
| 450 | |
| 451 | function resolveWindowsPathExtensions(env: NodeJS.ProcessEnv): ReadonlyArray<string> { |
| 452 | const rawValue = env.PATHEXT; |
| 453 | const fallback = [".COM", ".EXE", ".BAT", ".CMD"]; |
| 454 | if (!rawValue) return fallback; |
| 455 | |
| 456 | const parsed: string[] = []; |
| 457 | for (const entry of rawValue.split(";")) { |
| 458 | const trimmed = entry.trim(); |
| 459 | if (trimmed.length === 0) continue; |
| 460 | parsed.push(trimmed.startsWith(".") ? trimmed.toUpperCase() : `.${trimmed.toUpperCase()}`); |
| 461 | } |
| 462 | return parsed.length > 0 ? Array.from(new Set(parsed)) : fallback; |
| 463 | } |
| 464 | |
| 465 | function resolveCommandCandidates( |
| 466 | command: string, |
no outgoing calls
no test coverage detected