From 812d22560dd3f34d3bc06540529a2e6a39236a3b Mon Sep 17 00:00:00 2001 From: James George Date: Sun, 21 Apr 2019 12:02:52 +0530 Subject: [PATCH] chore: replace var with const in lib/adduser.js --- lib/adduser.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/adduser.js b/lib/adduser.js index e1c221032568d..cf82ff5b04915 100644 --- a/lib/adduser.js +++ b/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') @@ -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')) }