mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix crash when a package does not contain a version (retracted packages)
This commit is contained in:
parent
b935f8d4f4
commit
da865f855d
1 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,10 @@ export async function resolvePackageVersion(packageName, versionRange) {
|
|||
return distTags[versionRange];
|
||||
}
|
||||
|
||||
if (!packageInfo.versions) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If the version range is not a dist-tag, we need to resolve the highest version matching the range.
|
||||
// This is useful for ranges like "^1.0.0" or "~2.3.4".
|
||||
const availableVersions = Object.keys(packageInfo.versions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue