(name: string)
| 982 | * `git`. Returns lowercase canonical name. |
| 983 | */ |
| 984 | export function resolveToCanonical(name: string): string { |
| 985 | let lower = name.toLowerCase() |
| 986 | // Only strip PATHEXT on bare names — paths run a specific file, not the |
| 987 | // PATH-resolved executable the guards are protecting against. |
| 988 | if (!lower.includes('\\') && !lower.includes('/')) { |
| 989 | lower = lower.replace(WINDOWS_PATHEXT, '') |
| 990 | } |
| 991 | const alias = COMMON_ALIASES[lower] |
| 992 | if (alias) { |
| 993 | return alias.toLowerCase() |
| 994 | } |
| 995 | return lower |
| 996 | } |
| 997 | |
| 998 | /** |
| 999 | * Checks if a command name (after alias resolution) alters the path-resolution |
no outgoing calls
no test coverage detected