0
Fork 0
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:
Juan Picado @jotadeveloper 2017-07-08 18:34:52 +02:00
parent 5ee2faf125
commit 53349fd096
No known key found for this signature in database
GPG key ID: 18AC54485952D158
3 changed files with 11 additions and 6 deletions

View file

@ -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);

View file

@ -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;
});

View file

@ -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;
}