Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created October 12, 2021 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/fa2b4ca323aa1886af77d0b7991c8ef9 to your computer and use it in GitHub Desktop.
Save isaacs/fa2b4ca323aa1886af77d0b7991c8ef9 to your computer and use it in GitHub Desktop.
diff --git a/lib/can-place-dep.js b/lib/can-place-dep.js
index 6be59093..e4eba7ac 100644
--- a/lib/can-place-dep.js
+++ b/lib/can-place-dep.js
@@ -145,7 +145,9 @@ class CanPlaceDep {
return CONFLICT
}
- if (targetEdge && !dep.satisfies(targetEdge) && targetEdge !== this.edge) {
+ // skip this test if there's a current node, because we might be able
+ // to dedupe against it anyway
+ if (!current && targetEdge && !dep.satisfies(targetEdge) && targetEdge !== this.edge) {
return CONFLICT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment