aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-registry-client/lib/publish.js
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2015-02-06 01:14:25 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2015-02-06 18:38:36 +0100
commitaf1bf49852b7a8bcc9b9b6dd718edea0b18e3cb6 (patch)
treec9b3218b9df65485edca5f150bef4ba0263c8e28 /deps/npm/node_modules/npm-registry-client/lib/publish.js
parent9dc9ec3ce6ba6f3dd4020e00f5863e207fa08a75 (diff)
downloadandroid-node-v8-af1bf49852b7a8bcc9b9b6dd718edea0b18e3cb6.tar.gz
android-node-v8-af1bf49852b7a8bcc9b9b6dd718edea0b18e3cb6.tar.bz2
android-node-v8-af1bf49852b7a8bcc9b9b6dd718edea0b18e3cb6.zip
deps: upgrade npm to 2.5.1
PR-URL: https://github.com/iojs/io.js/pull/738 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/lib/publish.js')
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/publish.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js
index 24034a6b86..348648b2ee 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/publish.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js
@@ -18,10 +18,9 @@ function publish (uri, params, cb) {
assert(typeof cb === "function", "must pass callback to publish")
var access = params.access
- assert(access && typeof access === "string", "must pass access for package")
assert(
- ["public", "restricted"].indexOf(access) !== -1,
- "access level must be either 'public' or 'restricted'"
+ (!access) || ["public", "restricted"].indexOf(access) !== -1,
+ "if present, access level must be either 'public' or 'restricted'"
)
var auth = params.auth
@@ -68,12 +67,13 @@ function putFirst (registry, data, tarbuffer, access, auth, cb) {
{ _id : data.name
, name : data.name
, description : data.description
- , access : access
, "dist-tags" : {}
, versions : {}
, readme: data.readme || ""
}
+ if (access) root.access = access
+
if (!auth.token) {
root.maintainers = [{name : auth.username, email : auth.email}]
data.maintainers = JSON.parse(JSON.stringify(root.maintainers))