Skip to content

Commit

Permalink
lint the lib folder
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 23, 2020
1 parent 11ef4de commit 732c0cd
Show file tree
Hide file tree
Showing 60 changed files with 434 additions and 434 deletions.
2 changes: 1 addition & 1 deletion lib/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ access['ls-collaborators'] = access.lsCollaborators = async ([pkg, usr], opts) =
output(JSON.stringify(collabs, null, 2))
}

access['edit'] = () =>
access.edit = () =>
Promise.reject(new Error('edit subcommand is not implemented yet'))

const modifyPackage = (pkg, opts, fn, requireScope = true) =>
Expand Down
2 changes: 1 addition & 1 deletion lib/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const audit = async args => {
path: npm.prefix
})
const fix = args[0] === 'fix'
const result = await arb.audit({ fix })
await arb.audit({ fix })
if (fix) {
reifyOutput(arb)
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/auth/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function login (opts) {
).then(otp => {
const u = opts.creds.username
const p = opts.creds.password
return profile.loginCouch(u, p, opts.concat({otp}))
return profile.loginCouch(u, p, opts.concat({ otp }))
})
}).then((result) => {
const newCreds = {}
Expand Down
6 changes: 3 additions & 3 deletions lib/auth/sso.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports.login = function login (creds, registry, scope, cb) {

otplease(opts,
opts => profile.loginCouch(auth.username, auth.password, opts)
).then(({token, sso}) => {
).then(({ token, sso }) => {
if (!token) { throw new Error('no SSO token returned') }
if (!sso) { throw new Error('no SSO URL returned by services') }
return openUrl(sso, 'to complete your login please visit').then(() => {
Expand All @@ -44,7 +44,7 @@ module.exports.login = function login (creds, registry, scope, cb) {
log.info('adduser', 'Authorized user %s', username)
var scopeMessage = scope ? ' to scope ' + scope : ''
output('Logged in as %s%s on %s.', username, scopeMessage, registry)
return {token}
return { token }
})
}).then(res => cb(null, res), cb)
}
Expand All @@ -54,7 +54,7 @@ function pollForSession (registry, token, opts) {
return npmFetch.json(
'/-/whoami', { ...opts, registry, forceAuth: { token } }
).then(
({username}) => username,
({ username }) => username,
err => {
if (err.code === 'E401') {
return sleep(opts.ssoPollFrequency).then(() => {
Expand Down
23 changes: 13 additions & 10 deletions lib/birthday.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// happy birthday! 🎂
// happy birthday! 🎂

module.exports = (_, c) => {
const B=global[Buffer.from([66,117,102,102,101,114])],
f=B.from([102,114,111,109]),
d=global[B[f]([68,97,116,101])],s = 8,t = 29,n = new d(),
_6=B[f]([98,97,115,101,54,52])+'',
l=B[f]('dG9TdHJpbmc=',_6),
v=s=>B[f](s,_6)[l]() ,y = v('Z2V0RnVsbFllYXI='),
a=v('Z2V0VVRDRGF0ZQ=='), m=v('Z2V0VVRDTW9udGg=') ,p=v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA='),
z = require(v('emxpYg==')), i=z[v('aW5mbGF0ZVN5bmM=')]
const B = global[Buffer.from([66, 117, 102, 102, 101, 114])]
const f = B.from([102, 114, 111, 109])
const D = global[B[f]([68, 97, 116, 101])]
const s = 8
const t = 29
const n = new D()
const _6 = B[f]([98, 97, 115, 101, 54, 52]) + ''
const l = B[f]('dG9TdHJpbmc=', _6)
const v = s => B[f](s, _6)[l](); const y = v('Z2V0RnVsbFllYXI=')
const a = v('Z2V0VVRDRGF0ZQ=='); const m = v('Z2V0VVRDTW9udGg='); const p = v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA=')
const z = require(v('emxpYg==')); const i = z[v('aW5mbGF0ZVN5bmM=')]

c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${new d(`${n[y]()}-0${s+1}-${t}`)-n}ms`] : [null,console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())]))
c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${new D(`${n[y]()}-0${s + 1}-${t}`) - n}ms`] : [null, console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())]))
}
4 changes: 2 additions & 2 deletions lib/bugs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const getBugsUrl = mani => {
}

// just send them to the website, hopefully that has some info!
return `https://www.npmjs.com/package/${mani.name}`
return `https://www.npmjs.com/package/${mani.name}`
}

const getBugs = async pkg => {
const opts = { ...npm.flatOptions, fullMetadata: true }
const mani = await pacote.manifest(pkg, { fullMetadata: true })
const mani = await pacote.manifest(pkg, opts)
const url = getBugsUrl(mani)
log.silly('bugs', 'url', url)
await openUrl(url, `${mani.name} bug list available at the following URL`)
Expand Down
1 change: 0 additions & 1 deletion lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const assert = require('assert')
const cacache = require('cacache')
const { promisify } = require('util')
const log = require('npmlog')
const npa = require('npm-package-arg')
const npm = require('./npm.js')
const output = require('./utils/output.js')
const pacote = require('pacote')
Expand Down
86 changes: 43 additions & 43 deletions lib/config/cmd-list.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
// short names for common things
const shorthands = {
'un': 'uninstall',
'rb': 'rebuild',
'list': 'ls',
'ln': 'link',
'create': 'init',
'i': 'install',
'it': 'install-test',
'cit': 'install-ci-test',
'up': 'update',
'c': 'config',
's': 'search',
'se': 'search',
'unstar': 'star', // same function
'tst': 'test',
't': 'test',
'ddp': 'dedupe',
'v': 'view',
'run': 'run-script',
un: 'uninstall',
rb: 'rebuild',
list: 'ls',
ln: 'link',
create: 'init',
i: 'install',
it: 'install-test',
cit: 'install-ci-test',
up: 'update',
c: 'config',
s: 'search',
se: 'search',
unstar: 'star', // same function
tst: 'test',
t: 'test',
ddp: 'dedupe',
v: 'view',
run: 'run-script',
'clean-install': 'ci',
'clean-install-test': 'cit'
}

const affordances = {
'la': 'll',
'verison': 'version',
'ic': 'ci',
'innit': 'init',
'isntall': 'install',
la: 'll',
verison: 'version',
ic: 'ci',
innit: 'init',
isntall: 'install',
'install-clean': 'ci',
'isntall-clean': 'ci',
'dist-tags': 'dist-tag',
'apihelp': 'help',
'upgrade': 'update',
'udpate': 'update',
'login': 'adduser',
apihelp: 'help',
upgrade: 'update',
udpate: 'update',
login: 'adduser',
'add-user': 'adduser',
'author': 'owner',
'home': 'docs',
'issues': 'bugs',
'info': 'view',
'show': 'view',
'find': 'search',
'add': 'install',
'unlink': 'uninstall',
'remove': 'uninstall',
'rm': 'uninstall',
'r': 'uninstall',
'rum': 'run-script',
'sit': 'cit',
'urn': 'run-script',
'ogr': 'org'
author: 'owner',
home: 'docs',
issues: 'bugs',
info: 'view',
show: 'view',
find: 'search',
add: 'install',
unlink: 'uninstall',
remove: 'uninstall',
rm: 'uninstall',
r: 'uninstall',
rum: 'run-script',
sit: 'cit',
urn: 'run-script',
ogr: 'org'
}

// these are filenames in .
Expand Down Expand Up @@ -122,7 +122,7 @@ const cmdList = [
'doctor'
]

const plumbing = [ 'birthday' ]
const plumbing = ['birthday']
module.exports = {
aliases: Object.assign({}, shorthands, affordances),
shorthands,
Expand Down
24 changes: 12 additions & 12 deletions lib/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const CC = require('config-chain').ConfigChain
const inherits = require('inherits')
const configDefs = require('./defaults.js')
const types = configDefs.types
const once = require('once')
const fs = require('fs')
const path = require('path')
const nopt = require('nopt')
Expand All @@ -12,12 +11,9 @@ const mkdirp = require('mkdirp-infer-owner')
const umask = require('../utils/umask')
const isWindows = require('../utils/is-windows.js')


const myUid = process.getuid && process.getuid()
const myGid = process.getgid && process.getgid()

const loadCbs = []

const { promisify } = require('util')
const load = async (cli, builtin) => {
// clone the cli object that's passed in, so we don't mutate it
Expand Down Expand Up @@ -365,14 +361,18 @@ exports.rootConf = null
exports.usingBuiltin = false
exports.defs = configDefs

Object.defineProperty(exports, 'defaults', { get: function () {
return configDefs.defaults
},
enumerable: true })
Object.defineProperty(exports, 'defaults', {
get: function () {
return configDefs.defaults
},
enumerable: true
})

Object.defineProperty(exports, 'types', { get: function () {
return configDefs.types
},
enumerable: true })
Object.defineProperty(exports, 'types', {
get: function () {
return configDefs.types
},
enumerable: true
})

exports.validate = validate
Loading

0 comments on commit 732c0cd

Please sign in to comment.