Fix issue where we were sometimes filtering out certain node modules innapropriately. (#1807)
This commit is contained in:
parent
734f7beba7
commit
4dab630a1b
|
@ -79,8 +79,13 @@ export async function computeCodePaths(
|
||||||
|
|
||||||
function isSubsumedByHigherPath(path: string, pathSet: Set<string>): boolean {
|
function isSubsumedByHigherPath(path: string, pathSet: Set<string>): boolean {
|
||||||
for (const otherPath of pathSet) {
|
for (const otherPath of pathSet) {
|
||||||
if (path.length > otherPath.length && path.startsWith(otherPath)) {
|
if (path.length > otherPath.length &&
|
||||||
return true;
|
path.startsWith(otherPath)) {
|
||||||
|
|
||||||
|
// Have to make sure we're actually a sub-directory of that other path. For example,
|
||||||
|
// if we have: node_modules/mime-types, that's not subsumed by node_modules/mime
|
||||||
|
const nextChar = path.charAt(otherPath.length);
|
||||||
|
return nextChar === "/" || nextChar === "\\";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue