Skip to content

Commit

Permalink
Fix bug in handling of the module sort order for deduplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Mar 27, 2019
1 parent b130d92 commit 035b17f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/eyeglass/src/modules/EyeglassModules.ts
Expand Up @@ -305,11 +305,18 @@ export default class EyeglassModules {
newestModule = m
} else {
if (semver.compare(m.semver, newestModule.semver) > 0) {
if (secondNewestModule) { otherVersions.push(m); }
if (secondNewestModule) { otherVersions.push(secondNewestModule); }
secondNewestModule = newestModule;
newestModule = m;
} else {
otherVersions.push(m);
if (secondNewestModule && semver.compare(m.semver, secondNewestModule.semver) > 0) {
otherVersions.push(secondNewestModule);
secondNewestModule = m;
} else if (secondNewestModule) {
otherVersions.push(m);
} else {
secondNewestModule = m;
}
}
}
}
Expand Down

0 comments on commit 035b17f

Please sign in to comment.