0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] format

This commit is contained in:
Nate Moore 2023-12-11 10:48:10 +00:00 committed by astrobot-houston
parent a7c75b3339
commit d656797fce

View file

@ -642,15 +642,15 @@ async function convertIntegrationsToInstallSpecifiers(
}
/**
* Resolves package with a given range to a STABLE version
* peerDependencies might specify a compatible prerelease,
* but `astro add` should only ever install stable releases
*/
* Resolves package with a given range to a STABLE version
* peerDependencies might specify a compatible prerelease,
* but `astro add` should only ever install stable releases
*/
async function resolveRangeToInstallSpecifier(name: string, range: string): Promise<string> {
const versions = await fetchPackageVersions(name);
if (versions instanceof Error) return name;
// Filter out any prerelease versions
const stableVersions = versions.filter(v => !v.includes('-'));
const stableVersions = versions.filter((v) => !v.includes('-'));
const maxStable = maxSatisfying(stableVersions, range);
return `${name}@^${maxStable}`;
}