MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / expandUserPath

Function expandUserPath

src/extraction/index.ts:562–566  ·  view source on GitHub ↗

Expand a leading `~/` the way git does for `core.excludesFile`.

(p: string)

Source from the content-addressed store, hash-verified

560
561/** Expand a leading `~/` the way git does for `core.excludesFile`. */
562function expandUserPath(p: string): string {
563 if (p === '~') return os.homedir();
564 if (p.startsWith('~/')) return path.join(os.homedir(), p.slice(2));
565 return p;
566}
567
568/**
569 * Root-relative exclude patterns from git sources that are NOT the root

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected