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

Function expandTilde

src/tools/PowerShellTool/pathValidation.ts:820–829  ·  view source on GitHub ↗

* Expands tilde (~) at the start of a path to the user's home directory.

(filePath: string)

Source from the content-addressed store, hash-verified

818 * Expands tilde (~) at the start of a path to the user's home directory.
819 */
820function expandTilde(filePath: string): string {
821 if (
822 filePath === '~' ||
823 filePath.startsWith('~/') ||
824 filePath.startsWith('~\\')
825 ) {
826 return homedir() + filePath.slice(1)
827 }
828 return filePath
829}
830
831/**
832 * Checks the raw user-provided path (pre-realpath) for dangerous removal

Callers 4

validatePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected