From 4f148593516e3d8ad94385818de2f016e1216c56 Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Sat, 1 Nov 2025 13:24:57 +0100 Subject: [PATCH] Fix check --- packages/safe-chain/src/api/npmApi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/safe-chain/src/api/npmApi.js b/packages/safe-chain/src/api/npmApi.js index c8e2218..c03abef 100644 --- a/packages/safe-chain/src/api/npmApi.js +++ b/packages/safe-chain/src/api/npmApi.js @@ -17,7 +17,7 @@ export async function resolvePackageVersion(packageName, versionRange) { } const packageInfo = ( - /** @type {{"dist-tags"?: Record} | null} */ + /** @type {{"dist-tags"?: Record, versions?: Record} | null} */ await getPackageInfo(packageName) ); if (!packageInfo) { @@ -27,7 +27,7 @@ export async function resolvePackageVersion(packageName, versionRange) { } const distTags = packageInfo["dist-tags"]; - if (distTags && isDistTags(distTags)) { + if (distTags && isDistTags(distTags) && distTags[versionRange]) { // If the version range is a dist-tag, return the version associated with that tag // e.g., "latest", "next", etc. return distTags[versionRange];