File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -236,16 +236,17 @@ export function exportMermaid(db, opts = {}) {
236236 lines . push ( ' end' ) ;
237237 }
238238
239- // Deduplicate edges per source-target pair, keeping the first encountered kind
239+ // Deduplicate edges per source-target pair, collecting all distinct kinds
240240 const edgeMap = new Map ( ) ;
241241 for ( const { source, target, edge_kind } of edges ) {
242242 const key = `${ source } |${ target } ` ;
243243 const label = edge_kind === 'imports-type' ? 'imports' : edge_kind ;
244- if ( ! edgeMap . has ( key ) ) edgeMap . set ( key , { source, target, label } ) ;
244+ if ( ! edgeMap . has ( key ) ) edgeMap . set ( key , { source, target, labels : new Set ( ) } ) ;
245+ edgeMap . get ( key ) . labels . add ( label ) ;
245246 }
246247
247- for ( const { source, target, label } of edgeMap . values ( ) ) {
248- lines . push ( ` ${ nodeId ( source ) } -->|${ label } | ${ nodeId ( target ) } ` ) ;
248+ for ( const { source, target, labels } of edgeMap . values ( ) ) {
249+ lines . push ( ` ${ nodeId ( source ) } -->|${ [ ... labels ] . join ( ', ' ) } | ${ nodeId ( target ) } ` ) ;
249250 }
250251 } else {
251252 let edges = db
You can’t perform that action at this time.
0 commit comments