(edge: Edge, upward: boolean)
| 311 | * §3.5 fixes the phrasing — "via callback · registered at file:line". |
| 312 | */ |
| 313 | export function flowEdgeLabel(edge: Edge, upward: boolean): string { |
| 314 | const meta = (edge.metadata ?? {}) as Record<string, unknown>; |
| 315 | const parts: string[] = []; |
| 316 | if (edge.provenance === 'heuristic' && typeof meta.synthesizedBy === 'string') { |
| 317 | const mechanism = meta.synthesizedBy.replace(/-/g, ' '); |
| 318 | parts.push(`via ${mechanism}`); |
| 319 | if (typeof meta.via === 'string' && meta.via) parts.push(meta.via); |
| 320 | if (typeof meta.registeredAt === 'string' && meta.registeredAt) { |
| 321 | parts.push(`registered at ${meta.registeredAt}`); |
| 322 | } |
| 323 | } else { |
| 324 | parts.push(upward ? 'called by' : edge.kind); |
| 325 | } |
| 326 | return parts.join(' · '); |
| 327 | } |
| 328 | |
| 329 | function toFlowEdge(edge: Edge, upward: boolean): WireFlowEdge { |
| 330 | const meta = (edge.metadata ?? {}) as Record<string, unknown>; |
no test coverage detected