472
let releaseVersionIndex: number = -1;
473
for (const version of versions) {
475
>
const isCompatibleWithTargetPlatform = isTargetPlatformCompatible(versionTargetPlatform, allTargetPlatforms, targetPlatform);
476
>
477
>
// Always include versions that are NOT compatible with the target platform
478
>
if (!isCompatibleWithTargetPlatform) {
479
latestVersions.push(version);
480
continue;
481
}
483
>
// For compatible versions, only include the first (latest) of each type
484
>
// Prefer specific target platform matches over undefined/universal platforms only when version numbers are the same
485
>
if (isPreReleaseVersion(version)) {
486
if (preReleaseVersionIndex === -1) {
487
preReleaseVersionIndex = latestVersions.length;