1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(info): handle circular npm dependencies (#16692)

This commit is contained in:
David Sherret 2022-11-17 21:22:28 -05:00 committed by GitHub
parent 238590aa9f
commit 409e6c8402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -580,7 +580,8 @@ impl<'a> GraphDisplayContext<'a> {
)); ));
if let Some(package) = self.npm_info.packages.get(dep_id) { if let Some(package) = self.npm_info.packages.get(dep_id) {
if !package.dependencies.is_empty() { if !package.dependencies.is_empty() {
if self.seen.contains(&package.id.as_serialized()) { let was_seen = !self.seen.insert(package.id.as_serialized());
if was_seen {
child.text = format!("{} {}", child.text, colors::gray("*")); child.text = format!("{} {}", child.text, colors::gray("*"));
} else { } else {
let package = package.clone(); let package = package.clone();