MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / toWireEdge

Function toWireEdge

src/ui-server/api/wire.ts:192–205  ·  view source on GitHub ↗
(edge: Edge)

Source from the content-addressed store, hash-verified

190}
191
192export function toWireEdge(edge: Edge): WireEdge {
193 const meta = (edge.metadata ?? {}) as Record<string, unknown>;
194 const wire: WireEdge = { kind: edge.kind };
195 if (typeof edge.line === 'number') wire.line = edge.line;
196 if (typeof edge.column === 'number') wire.col = edge.column;
197 if (typeof meta.confidence === 'number') wire.confidence = meta.confidence;
198 if (typeof meta.resolvedBy === 'string') wire.resolvedBy = meta.resolvedBy;
199 if (edge.provenance) wire.provenance = edge.provenance;
200 if (typeof meta.synthesizedBy === 'string') wire.synthesizedBy = meta.synthesizedBy;
201 if (typeof meta.via === 'string') wire.via = meta.via;
202 if (typeof meta.registeredAt === 'string') wire.registeredAt = meta.registeredAt;
203 if (meta.valueRef === true) wire.valueRef = true;
204 return wire;
205}
206
207// =============================================================================
208// Relations — edges grouped by the symbol at the other end

Callers 1

toFlowEdgeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected