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

Method extractFileFromId

frontend/src/cache.ts:490–498  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

488 // For cross-batch edges, target might not be in nodeToFile
489 // Extract file from deterministic ID format: path::function or path::function::line
490 const extractFileFromId = (id: string): string | undefined => {
491 // Format: relative/path.ext::function or relative/path.ext::function::line
492 // Split on :: (unambiguous since : is forbidden in filenames)
493 const parts = id.split('::');
494 if (parts.length >= 2) {
495 return parts[0]; // First part is the relative file path
496 }
497 return undefined;
498 };
499
500 const resolvedSourceFile = sourceFile || extractFileFromId(edge.source);
501 const resolvedTargetFile = targetFile || extractFileFromId(edge.target);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected