MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / normalizePath

Function normalizePath

graph-ui/src/pseudocode/imports-source.ts:201–214  ·  view source on GitHub ↗

`a/b/../c` zu `a/c`. Rein textlich; es wird nichts am Dateisystem geprueft.

(path: string)

Source from the content-addressed store, hash-verified

199
200/** `a/b/../c` zu `a/c`. Rein textlich; es wird nichts am Dateisystem geprueft. */
201function normalizePath(path: string): string {
202 const out: string[] = [];
203 for (const segment of path.split('/')) {
204 if (segment === '' || segment === '.') {
205 continue;
206 }
207 if (segment === '..') {
208 out.pop();
209 continue;
210 }
211 out.push(segment);
212 }
213 return out.join('/');
214}
215
216/**
217 * Welche indizierte Datei ein Spezifizierer meint, wenn eine davon passt.

Callers 1

resolveImportTargetFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected