Permalink
Browse files

sort versions

  • Loading branch information...
1 parent 01a4232 commit 85da8a23f62bea437b89ff07aa766336fa82eaf1 @isaacs isaacs committed Mar 22, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/view.js
View
@@ -13,7 +13,7 @@ view.completion = function (opts, cb) {
if (er) return cb(er)
var dv = d.versions[d["dist-tags"][tag]]
, fields = []
- d.versions = Object.keys(d.versions)
+ d.versions = Object.keys(d.versions).sort(semver.compare)
fields = getFields(d).concat(getFields(dv))
cb(null, fields)
})
@@ -64,7 +64,7 @@ function view (args, silent, cb) {
var results = []
, error = null
, versions = data.versions
- data.versions = Object.keys(data.versions)
+ data.versions = Object.keys(data.versions).sort(semver.compare)
if (!args.length) args = [""]
Object.keys(versions).forEach(function (v) {
try {

0 comments on commit 85da8a2

Please sign in to comment.