Skip to content

Commit

Permalink
chore: replace var with const in lib/adduser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored and isaacs committed Jun 30, 2019
1 parent 747fdaf commit 8d4effb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/adduser.js
@@ -1,9 +1,9 @@
module.exports = adduser

var log = require('npmlog')
var npm = require('./npm.js')
var usage = require('./utils/usage')
var crypto
const log = require('npmlog')
const npm = require('./npm.js')
const usage = require('./utils/usage')
let crypto

try {
crypto = require('crypto')
Expand All @@ -21,20 +21,21 @@ function adduser (args, cb) {
))
}

var registry = npm.config.get('registry')
var scope = npm.config.get('scope')
var creds = npm.config.getCredentialsByURI(npm.config.get('registry'))
let registry = npm.config.get('registry')
const scope = npm.config.get('scope')
const creds = npm.config.getCredentialsByURI(npm.config.get('registry'))

if (scope) {
var scopedRegistry = npm.config.get(scope + ':registry')
var cliRegistry = npm.config.get('registry', 'cli')
const scopedRegistry = npm.config.get(scope + ':registry')
const cliRegistry = npm.config.get('registry', 'cli')
if (scopedRegistry && !cliRegistry) registry = scopedRegistry
}

log.disableProgress()

let auth
try {
var auth = require('./auth/' + npm.config.get('auth-type'))
auth = require('./auth/' + npm.config.get('auth-type'))
} catch (e) {
return cb(new Error('no such auth module'))
}
Expand Down

0 comments on commit 8d4effb

Please sign in to comment.