MCPcopy Create free account
hub / github.com/codag-megalith/codag-visualizer / parseNodeId

Function parseNodeId

frontend/src/edge-resolver.ts:22–32  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

20 * Example: backend/client.py::check::42 → {file: "backend/client.py", func: "check", line: 42}
21 */
22export function parseNodeId(id: string): { file: string; func: string; line?: number } | null {
23 // Split on :: (unambiguous since : is forbidden in filenames)
24 const parts = id.split('::');
25 if (parts.length < 2) return null;
26
27 const file = parts[0]; // First part is relative file path
28 const func = parts[1]; // Second part is function name
29 const line = parts[2] ? parseInt(parts[2], 10) : undefined; // Optional line number
30
31 return { file, func, line: isNaN(line as number) ? undefined : line };
32}
33
34/**
35 * Convert module notation to file path notation

Callers 2

buildNodeLookupFunction · 0.85
findMatchingNodeIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected