MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resolveToCanonical

Function resolveToCanonical

src/tools/PowerShellTool/readOnlyValidation.ts:984–996  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

982 * `git`. Returns lowercase canonical name.
983 */
984export 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

Callers 13

isSymlinkCreatingCommandFunction · 0.85
isCwdChangingCmdletFunction · 0.85
isSafeOutputCommandFunction · 0.85
lookupAllowlistFunction · 0.85
isAllowlistedCommandFunction · 0.85
extractPathsFromCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected