Skip to content

Commit

Permalink
So is ctime, for that matter.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Oct 4, 2010
1 parent ccf1407 commit 740676f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app.js
Expand Up @@ -37,10 +37,7 @@ ddoc.lists.index = function (head, req) {
while (row = getRow()) {
var p = out[row.id] = {}
for (var i in row.value) {
if (i === "versions"
|| i.charAt(0) === "_"
|| i === "ctime"
) continue
if (i === "versions" || i.charAt(0) === "_") continue
p[i] = row.value[i]
}
p.versions = {}
Expand Down Expand Up @@ -141,7 +138,6 @@ ddoc.updates.package = function (doc, req) {
if (body.description) doc.description = body.description
if (body.author) doc.author = body.author
if (body.repository) doc.repository = body.repository
body.ctime = now
doc["dist-tags"].latest = body.version
doc.versions[req.query.version] = body
return [doc, JSON.stringify({ok:"added version"})]
Expand All @@ -167,12 +163,10 @@ ddoc.updates.package = function (doc, req) {
if (!doc.versions) doc.versions = {}
var latest
for (var v in doc.versions) {
doc.versions[v].ctime = now
latest = v
}
if (latest) doc["dist-tags"].latest = latest
if (!doc['dist-tags']) doc['dist-tags'] = {}
doc.ctime = now
return [doc, JSON.stringify({ok:"created new entry"})]
}
}
Expand Down

0 comments on commit 740676f

Please sign in to comment.