node-modules-hunter 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5395,9 +5395,15 @@ async function isNpmGlobal() {
|
|
|
5395
5395
|
}
|
|
5396
5396
|
async function distTagsMap(allowSpawn) {
|
|
5397
5397
|
const collect = (raw2) => {
|
|
5398
|
-
|
|
5398
|
+
let source = raw2;
|
|
5399
|
+
if (Array.isArray(raw2)) {
|
|
5400
|
+
const objects = raw2.filter((item) => item !== null && typeof item === "object");
|
|
5401
|
+
if (objects.length === 0) return null;
|
|
5402
|
+
source = objects[objects.length - 1];
|
|
5403
|
+
}
|
|
5404
|
+
if (source === null || typeof source !== "object" || Array.isArray(source)) return null;
|
|
5399
5405
|
const out = {};
|
|
5400
|
-
for (const [name, version] of Object.entries(
|
|
5406
|
+
for (const [name, version] of Object.entries(source)) {
|
|
5401
5407
|
if (typeof version === "string" && VERSION_SHAPE.test(version)) out[name] = version;
|
|
5402
5408
|
}
|
|
5403
5409
|
return Object.keys(out).length > 0 ? out : null;
|
package/package.json
CHANGED