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

Function expandTilde

src/utils/permissions/pathValidation.ts:80–89  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

78 * Note: ~username expansion is not supported for security reasons.
79 */
80export function expandTilde(path: string): string {
81 if (
82 path === '~' ||
83 path.startsWith('~/') ||
84 (process.platform === 'win32' && path.startsWith('~\\'))
85 ) {
86 return homedir() + path.slice(1)
87 }
88 return path
89}
90
91/**
92 * Checks if a resolved path is writable according to the sandbox write allowlist.

Callers 3

validatePathFunction · 0.70
getPluginZipCachePathFunction · 0.50
getPluginsDirectoryFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected