We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c01b0b5 commit e42da31Copy full SHA for e42da31
src/dapp/libexec/dapp/dapp-remappings
@@ -52,7 +52,11 @@ function deduplicate(pkg) {
52
// walk tree and build a mapping from hash => path
53
function mapHashes(pkg) {
54
const go = (mapping, dep) => {
55
- mapping[dep.hash] = dep.path
+ // we collect the shortest path (aka closest to the root) for each dep
56
+ if (mapping[dep.hash] == undefined || dep.path.length < mapping[dep.hash].length) {
57
+ mapping[dep.hash] = dep.path
58
+ }
59
+
60
return dep.deps.reduce(go, mapping)
61
}
62
return pkg.deps.reduce(go, { [pkg.hash]: pkg.path })
0 commit comments