Skip to content

Commit

Permalink
fix: stop hard failures on npm dist-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPatrickGill committed Jan 26, 2024
1 parent eb952ee commit 2501435
Show file tree
Hide file tree
Showing 5 changed files with 23,310 additions and 7 deletions.
16 changes: 10 additions & 6 deletions lib/dep-graph-builders/npm-lock-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,17 @@ export const getChildNodeKey = (
}

// So now we can check semver to filter out some values
const candidatePkgVersion = pkgs[candidate].version;
const doesVersionSatisfySemver = semver.satisfies(
candidatePkgVersion,
version,
);
// if our version is valid semver
if (semver.validRange(version)) {
const candidatePkgVersion = pkgs[candidate].version;
const doesVersionSatisfySemver = semver.satisfies(
candidatePkgVersion,
version,
);
return doesVersionSatisfySemver;
}

return doesVersionSatisfySemver;
return true;
});

if (filteredCandidates.length === 1) {
Expand Down
Loading

0 comments on commit 2501435

Please sign in to comment.