Skip to content
Sign up
Sign in
This repository
Explore
Features
Enterprise
Blog
Star
342
Fork
121
npm
/
npm-registry-couchapp
Code
Issues
Pull Requests
Pulse
Graphs
HTTPS
clone URL
Subversion
checkout URL
You can clone with
HTTPS
or
Subversion
.
Download ZIP
Permalink
Browse code
make inline attachments possible
Loading branch information
...
commit
c2279447cf1e1b1a55b51f768d2bb66bb3514381
1 parent
4400be5
dominictarr
authored
Dec 12, 2013
isaacs
committed
Dec 11, 2013
Unified
Split
Showing
1 changed file
with
14 additions
and
0 deletions
.
+
14
−
0
registry/updates.js
14
registry/updates.js
Show notes
View
@@ -110,6 +110,19 @@ updates.package = function (doc, req) {
if (!doc.users) doc.users = {}
doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name]
}
+
+ if(newdoc._attachments) {
+ var inline = false
+ for(var k in newdoc._attachments) {
+ if(newdoc._attachments[k].data) {
+ doc._attachments[k] = newdoc._attachments[k]
+ inline = true
+ }
+ }
+ if(inline)
+ return ok(doc, "updated package metadata & attachments")
+ }
+
return ok(doc, "updated package metadata")
} else {
// Create new package doc
@@ -127,6 +140,7 @@ updates.package = function (doc, req) {
}
if (!doc['dist-tags']) doc['dist-tags'] = {}
if (latest) doc["dist-tags"].latest = latest
+
return ok(doc, "created new entry")
}
}
Toggle all file notes
Please
sign in
to comment.
Something went wrong with that request. Please try again.