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

Function normalizePath

graph-ui/src/agents/agent-placement.ts:93–105  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

91
92/** Ein Pfad ohne fuehrende Punkte und Schraegstriche, mit `/` als Trenner. */
93export function normalizePath(path: string): string {
94 let value = path.trim().replace(/\\/g, '/');
95 while (value.startsWith('./')) {
96 value = value.slice(2);
97 }
98 while (value.startsWith('/')) {
99 value = value.slice(1);
100 }
101 while (value.endsWith('/') && value.length > 1) {
102 value = value.slice(0, -1);
103 }
104 return value;
105}
106
107/** Den Index einmal bauen. */
108export function buildPlacementIndex(nodes: readonly GraphNode[]): PlacementIndex {

Callers 4

buildPlacementIndexFunction · 0.70
testedPathOfFunction · 0.70
placeEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected