mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-17 23:45:29 -05:00
fix: eslint errors
This commit is contained in:
parent
5ee2faf125
commit
53349fd096
3 changed files with 11 additions and 6 deletions
|
@ -55,8 +55,9 @@ class Auth {
|
|||
},
|
||||
|
||||
adduser: function(user, password, cb) {
|
||||
if (config.users && config.users[user])
|
||||
return cb( Error[403]('this user already exists') );
|
||||
if (config.users && config.users[user]) {
|
||||
return cb(Error[403]('this user already exists'));
|
||||
}
|
||||
|
||||
return cb();
|
||||
},
|
||||
|
@ -301,8 +302,9 @@ class Auth {
|
|||
let scheme = parts[0];
|
||||
let token = parts[1];
|
||||
|
||||
if (scheme !== 'Bearer')
|
||||
if (scheme !== 'Bearer') {
|
||||
return next();
|
||||
}
|
||||
let user;
|
||||
try {
|
||||
user = self.decode_token(token);
|
||||
|
|
|
@ -58,13 +58,15 @@ function load_plugins(config, plugin_configs, params, sanity_check) {
|
|||
throw Error('"' + p + '" plugin not found\ntry "npm install verdaccio-' + p + '"');
|
||||
}
|
||||
|
||||
if (typeof(plugin) !== 'function')
|
||||
if (typeof(plugin) !== 'function') {
|
||||
throw Error('"' + p + '" doesn\'t look like a valid plugin');
|
||||
}
|
||||
|
||||
plugin = plugin(plugin_configs[p], params);
|
||||
|
||||
if (plugin === null || !sanity_check(plugin))
|
||||
if (plugin === null || !sanity_check(plugin)) {
|
||||
throw Error('"' + p + '" doesn\'t look like a valid plugin');
|
||||
}
|
||||
|
||||
return plugin;
|
||||
});
|
||||
|
|
|
@ -296,8 +296,9 @@ class ProxyStorage {
|
|||
if (data) {
|
||||
current_length += data.length;
|
||||
}
|
||||
if (expected_length && current_length != expected_length)
|
||||
if (expected_length && current_length != expected_length) {
|
||||
stream.emit('error', createError('content length mismatch'));
|
||||
}
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue