MCPcopy
hub / github.com/callstack/agent-device / expandUserHomePath

Function expandUserHomePath

src/utils/path-resolution.ts:14–20  ·  view source on GitHub ↗
(inputPath: string, options: PathResolutionOptions = {})

Source from the content-addressed store, hash-verified

12}
13
14export function expandUserHomePath(inputPath: string, options: PathResolutionOptions = {}): string {
15 if (inputPath === '~') return resolveHomeDirectory(options.env);
16 if (inputPath.startsWith('~/')) {
17 return path.join(resolveHomeDirectory(options.env), inputPath.slice(2));
18 }
19 return inputPath;
20}
21
22export function resolveUserPath(inputPath: string, options: PathResolutionOptions = {}): string {
23 const expandedPath = expandUserHomePath(inputPath, options);

Callers 5

resolveUserConfigPathFunction · 0.90
expandSourcePathFunction · 0.90
resolveUserPathFunction · 0.85

Calls 2

resolveHomeDirectoryFunction · 0.85
startsWithMethod · 0.80

Tested by

no test coverage detected