@@ -0,0 +1,24 @@
|
||||
diff --git a/out/node-module-collector/moduleManager.js b/out/node-module-collector/moduleManager.js
|
||||
index f483d9387a3270afc884b8478f19dd2825477a04..a6b2a28befda5881e45368a07ae793f64f4aed41 100644
|
||||
--- a/out/node-module-collector/moduleManager.js
|
||||
+++ b/out/node-module-collector/moduleManager.js
|
||||
@@ -115,8 +115,7 @@ class ModuleManager {
|
||||
return { packageDir: path.dirname(direct), packageJson: json };
|
||||
}
|
||||
}
|
||||
- // 2) upward hoisted search, then 3) downward non-hoisted search
|
||||
- return (await this.upwardSearch(parentDir, pkgName, requiredRange)) || (await this.downwardSearch(parentDir, pkgName, requiredRange)) || null;
|
||||
+ return (await this.upwardSearch(parentDir, pkgName, requiredRange)) || null;
|
||||
}
|
||||
semverSatisfies(found, range) {
|
||||
if ((0, builder_util_1.isEmptyOrSpaces)(range) || range === "*") {
|
||||
@@ -157,6 +156,9 @@ class ModuleManager {
|
||||
let current = path.resolve(parentDir);
|
||||
const root = path.parse(current).root;
|
||||
while (true) {
|
||||
+ const pkg = await this.downwardSearch(current, pkgName, requiredRange);
|
||||
+ if (pkg) return pkg;
|
||||
+
|
||||
const candidate = path.join(current, "node_modules", pkgName, "package.json");
|
||||
if (await this.exists[candidate]) {
|
||||
const json = await this.json[candidate];
|
||||
Reference in New Issue
Block a user