diff --git a/dist/index.js b/dist/index.js index c8d6ca2..059df84 100644 --- a/dist/index.js +++ b/dist/index.js @@ -180416,12 +180416,13 @@ function getLatestEsyNPMInfo(alternativeEsyNPMPackage) { let esyPackage; if (!alternativeEsyNPMPackage || alternativeEsyNPMPackage === "") { // No alternative was provided. So, fallback to default - esyPackage = "esy"; + esyPackage = "esy@latest"; } else { - const { validForOldPackages, validForNewPackages, errors = [], } = lib_default()(alternativeEsyNPMPackage); + const [packageName, _packageVersion] = alternativeEsyNPMPackage.split("@"); + const { validForOldPackages, validForNewPackages, errors = [], } = lib_default()(packageName); if (!validForNewPackages || !validForOldPackages) { - throw new Error(`Invalid alternative NPM package name provided: ${alternativeEsyNPMPackage} + throw new Error(`Invalid alternative NPM package name provided: ${packageName} Errors: ${errors.join("\n")}`); } diff --git a/index.ts b/index.ts index 9ee0031..fa4306c 100644 --- a/index.ts +++ b/index.ts @@ -46,15 +46,16 @@ function getLatestEsyNPMInfo( let esyPackage; if (!alternativeEsyNPMPackage || alternativeEsyNPMPackage === "") { // No alternative was provided. So, fallback to default - esyPackage = "esy"; + esyPackage = "esy@latest"; } else { + const [packageName, _packageVersion] = alternativeEsyNPMPackage.split("@"); const { validForOldPackages, validForNewPackages, errors = [], - } = validateNPMPackageName(alternativeEsyNPMPackage); + } = validateNPMPackageName(packageName); if (!validForNewPackages || !validForOldPackages) { - throw new Error(`Invalid alternative NPM package name provided: ${alternativeEsyNPMPackage} + throw new Error(`Invalid alternative NPM package name provided: ${packageName} Errors: ${errors.join("\n")}`); }