From fa0a197c2f692f45815a29f9160ff9b37edd280e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 17 Nov 2022 21:22:28 -0500 Subject: [PATCH] fix(info): handle circular npm dependencies (#16692) --- cli/tools/info.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/tools/info.rs b/cli/tools/info.rs index 99541c2077..f718d8e52d 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -580,7 +580,8 @@ impl<'a> GraphDisplayContext<'a> { )); if let Some(package) = self.npm_info.packages.get(dep_id) { 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("*")); } else { let package = package.clone();