(id: string)
| 20 | * Example: backend/client.py::check::42 → {file: "backend/client.py", func: "check", line: 42} |
| 21 | */ |
| 22 | export 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 |
no outgoing calls
no test coverage detected