Skip to content

Commit 88e461e

Browse files
committed
Revert a refactor that introduces more code paths than required
1 parent 142defa commit 88e461e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/bundle.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,19 @@ function findNodeFromPath(referencePath, allData) {
9090
const isReferenceRemoteURL = stringIsAValidUrl(referencePath),
9191
partialComponents = referencePath.split(localPointer),
9292
isPartial = partialComponents.length > 1;
93-
if (isPartial && !isReferenceRemoteURL) {
94-
referencePath = partialComponents.slice(0, partialComponents.length - 1).join('#');
95-
}
9693

9794
let node = allData.find((node) => {
95+
if (isPartial && !isReferenceRemoteURL) {
96+
referencePath = partialComponents[0];
97+
}
98+
9899
if (isReferenceRemoteURL) {
99100
return _.startsWith(node.path, referencePath);
100101
}
101102

102103
return comparePaths(node.fileName, referencePath);
103104
});
105+
104106
return node;
105107
}
106108

0 commit comments

Comments
 (0)