MCPcopy
hub / github.com/opactorai/Claudable / normalizeRelativePath

Function normalizeRelativePath

lib/services/file-browser.ts:65–74  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

63}
64
65function normalizeRelativePath(dir: string): string {
66 const cleaned = dir
67 .replace(/\\/g, '/')
68 .replace(/^\.?\//, '')
69 .replace(/\/+$/, '');
70 if (cleaned === '') {
71 return '.';
72 }
73 return cleaned;
74}
75
76function joinRelativePath(parent: string, child: string): string {
77 if (parent === '.' || parent === '') {

Callers 3

listProjectDirectoryFunction · 0.85
readProjectFileContentFunction · 0.85
writeProjectFileContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected