diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js index e1e17cde50b..7af351d6359 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js +++ b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js @@ -1,39 +1,39 @@ module.exports = set -var assert = require("assert") -var url = require("url") +var assert = require('assert') +var url = require('url') -var npa = require("npm-package-arg") +var npa = require('npm-package-arg') function set (uri, params, cb) { - assert(typeof uri === "string", "must pass registry URI to distTags.set") + assert(typeof uri === 'string', 'must pass registry URI to distTags.set') assert( - params && typeof params === "object", - "must pass params to distTags.set" + params && typeof params === 'object', + 'must pass params to distTags.set' ) - assert(typeof cb === "function", "muss pass callback to distTags.set") + assert(typeof cb === 'function', 'muss pass callback to distTags.set') assert( - typeof params.package === "string", - "must pass package name to distTags.set" + typeof params.package === 'string', + 'must pass package name to distTags.set' ) assert( - params.distTags && typeof params.distTags === "object", - "must pass distTags map to distTags.set" + params.distTags && typeof params.distTags === 'object', + 'must pass distTags map to distTags.set' ) assert( - params.auth && typeof params.auth === "object", - "must pass auth to distTags.set" + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.set' ) var p = npa(params.package) - var package = p.scope ? params.package.replace("/", "%2f") : params.package - var rest = "-/package/"+package+"/dist-tags" + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags' var options = { - method : "PUT", - body : JSON.stringify(params.distTags), - auth : params.auth + method: 'PUT', + body: JSON.stringify(params.distTags), + auth: params.auth } this.request(url.resolve(uri, rest), options, cb) } |