File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/client/src/composables Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -356,15 +356,21 @@ export function parseGraphRawData(modules: ModuleInfo[], root: string) {
356356 }
357357
358358 const uniqueDeps = getUniqueDeps ( mod . deps , ( dep ) => {
359+ node . edges . push ( getEdge ( mod . id , dep ) )
359360 // save references
360361 if ( ! moduleReferences . has ( dep ) )
361362 moduleReferences . set ( dep , [ ] )
362- moduleReferences . get ( dep ) ! . push ( {
363+ const moduleReferencesValue = moduleReferences . get ( dep ) !
364+ const displayPath = removeRootPath ( path )
365+ const isExist = ! ! ( moduleReferencesValue . find ( item => item . path === path && item . displayPath === displayPath && item . mod . id === mod . id ) )
366+ if ( isExist )
367+ return
368+
369+ moduleReferencesValue . push ( {
363370 path,
364- displayPath : removeRootPath ( path ) ,
371+ displayPath,
365372 mod,
366373 } )
367- node . edges . push ( getEdge ( mod . id , dep ) )
368374 } )
369375 mod . deps = uniqueDeps
370376 graphNodesTotal . value . push ( node )
You can’t perform that action at this time.
0 commit comments