Minor fix to sorting versions.

This commit is contained in:
André Cruz
2013-06-11 09:02:12 +01:00
parent 6ec31cc7f9
commit 1aed2b9a43
2 changed files with 4 additions and 4 deletions

View File

@@ -530,10 +530,10 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
} else {
// Give priority to the one that is a version
if (version1) {
return 1;
return -1;
}
if (version2) {
return -1;
return 1;
}
}

View File

@@ -226,10 +226,10 @@ ResolveCache.prototype.list = function () {
return semver.compare(pkgMeta1.version, pkgMeta2.version);
}
if (pkgMeta1.version) {
return 1;
return -1;
}
if (pkgMeta2.version) {
return -1;
return 1;
}
return 0;