Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
meta: update standard formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 8, 2018
1 parent 7e34058 commit d70399b
Show file tree
Hide file tree
Showing 12 changed files with 566 additions and 548 deletions.
8 changes: 4 additions & 4 deletions lib/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function apiUri (registryUri) {

function accessAssertions (subcommand, uri, params, cb) {
assert(subcommands.hasOwnProperty(subcommand),
'access subcommand must be one of ' +
'access subcommand must be one of ' +
Object.keys(subcommands).join(', '))
typeChecks({
'uri': [uri, 'string'],
Expand All @@ -106,7 +106,7 @@ function accessAssertions (subcommand, uri, params, cb) {
], subcommand)) {
typeChecks({ 'package': [params.package, 'string'] })
assert(!!npa(params.package).scope,
'access commands are only accessible for scoped packages')
'access commands are only accessible for scoped packages')
}
if (contains(['grant', 'revoke', 'ls-packages'], subcommand)) {
typeChecks({ 'scope': [params.scope, 'string'] })
Expand All @@ -118,7 +118,7 @@ function accessAssertions (subcommand, uri, params, cb) {
typeChecks({ 'permissions': [params.permissions, 'string'] })
assert(params.permissions === 'read-only' ||
params.permissions === 'read-write',
'permissions must be either read-only or read-write')
'permissions must be either read-only or read-write')
}
}

Expand All @@ -127,7 +127,7 @@ function typeChecks (specs) {
var checks = specs[key]
/* eslint valid-typeof:0 */
assert(typeof checks[0] === checks[1],
key + ' is required and must be of type ' + checks[1])
key + ' is required and must be of type ' + checks[1])
})
}

Expand Down
3 changes: 1 addition & 2 deletions lib/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = adduser

var url = require('url')
var assert = require('assert')
var extend = Object.assign || require('util')._extend

function adduser (uri, params, cb) {
assert(typeof uri === 'string', 'must pass registry URI to adduser')
Expand Down Expand Up @@ -68,7 +67,7 @@ function adduser (uri, params, cb) {
}
this.request(
uri,
extend({}, options),
Object.assign({}, options),
function (error, data, json, response) {
if (!error || !response || response.statusCode !== 409) {
return cb(error, data, json, response)
Expand Down
2 changes: 1 addition & 1 deletion lib/org.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function apiUri (registryUri) {
function orgAssertions (subcommand, uri, params, cb) {
assert(subcommand, 'subcommand is required')
assert(subcommands.hasOwnProperty(subcommand),
'org subcommand must be one of ' + Object.keys(subcommands))
'org subcommand must be one of ' + Object.keys(subcommands))
assert(typeof uri === 'string', 'registry URI is required')
assert(typeof params === 'object', 'params are required')
assert(typeof params.auth === 'object', 'auth is required')
Expand Down
2 changes: 1 addition & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function putFirst (registry, data, tarbuffer, access, auth, cb) {
// Legacy shasum support
data.dist.shasum = integrity['sha1'][0].hexDigest()
data.dist.tarball = url.resolve(registry, tbURI)
.replace(/^https:\/\//, 'http://')
.replace(/^https:\/\//, 'http://')

root._attachments = {}
root._attachments[ tbName ] = {
Expand Down
4 changes: 2 additions & 2 deletions lib/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function apiUri (registryUri) {
function teamAssertions (subcommand, uri, params, cb) {
assert(subcommand, 'subcommand is required')
assert(subcommands.hasOwnProperty(subcommand),
'team subcommand must be one of ' + Object.keys(subcommands))
'team subcommand must be one of ' + Object.keys(subcommands))
assert(typeof uri === 'string', 'registry URI is required')
assert(typeof params === 'object', 'params are required')
assert(typeof params.auth === 'object', 'auth is required')
Expand All @@ -100,6 +100,6 @@ function teamAssertions (subcommand, uri, params, cb) {
if (subcommand === 'edit') {
assert(typeof params.users === 'object' &&
params.users.length != null,
'users is required')
'users is required')
}
}
Loading

0 comments on commit d70399b

Please sign in to comment.