mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
jshinting
This commit is contained in:
parent
77fccaa1e5
commit
2675196672
3 changed files with 22 additions and 22 deletions
|
@ -61,28 +61,28 @@ function Config(config) {
|
|||
, 'CONFIG: wrong url format for uplink: ' + i);
|
||||
this.uplinks[i].url = this.uplinks[i].url.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
for (var i in this.packages) {
|
||||
var check_userlist = function(i, hash, action) {
|
||||
if (hash[action] == null) hash[action] = [];
|
||||
|
||||
function check_userlist(i, hash, action) {
|
||||
if (hash[action] == null) hash[action] = [];
|
||||
|
||||
// if it's a string, split it to array
|
||||
if (typeof(hash[action]) === 'string') {
|
||||
hash[action] = hash[action].split(/\s+/);
|
||||
}
|
||||
|
||||
assert(
|
||||
typeof(hash[action]) === 'object' &&
|
||||
Array.isArray(hash[action])
|
||||
, 'CONFIG: bad "'+i+'" package '+action+' description (array or string expected)');
|
||||
hash[action] = flatten(hash[action]);
|
||||
hash[action].forEach(function(user) {
|
||||
assert(
|
||||
users[user] != null
|
||||
, 'CONFIG: "'+i+'" package: user "'+user+'" doesn\'t exist');
|
||||
});
|
||||
// if it's a string, split it to array
|
||||
if (typeof(hash[action]) === 'string') {
|
||||
hash[action] = hash[action].split(/\s+/);
|
||||
}
|
||||
|
||||
assert(
|
||||
typeof(hash[action]) === 'object' &&
|
||||
Array.isArray(hash[action])
|
||||
, 'CONFIG: bad "'+i+'" package '+action+' description (array or string expected)');
|
||||
hash[action] = flatten(hash[action]);
|
||||
hash[action].forEach(function(user) {
|
||||
assert(
|
||||
users[user] != null
|
||||
, 'CONFIG: "'+i+'" package: user "'+user+'" doesn\'t exist');
|
||||
});
|
||||
}
|
||||
|
||||
for (var i in this.packages) {
|
||||
assert(
|
||||
typeof(this.packages[i]) === 'object' &&
|
||||
!Array.isArray(this.packages[i])
|
||||
|
|
|
@ -184,7 +184,7 @@ Storage.prototype.add_tarball = function(name, filename) {
|
|||
upstream._sinopia_success = true;
|
||||
if (upstreams.filter(function(upstream) {
|
||||
return !upstream._sinopia_success;
|
||||
}).length == 0) {
|
||||
}).length === 0) {
|
||||
stream.emit('success');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,11 +12,11 @@ function Storage(config, mainconfig) {
|
|||
this.config = config;
|
||||
this.is_alive = false;
|
||||
this.userAgent = mainconfig.user_agent;
|
||||
this.ca;
|
||||
this.ca = config.ca;
|
||||
|
||||
this.url = URL.parse(this.config.url);
|
||||
if (this.url.hostname === 'registry.npmjs.org') {
|
||||
this.ca = require('./npmsslkeys');
|
||||
this.ca = this.ca || require('./npmsslkeys');
|
||||
|
||||
// npm registry is too slow working with ssl :(
|
||||
/*if (this.config._autogenerated) {
|
||||
|
|
Loading…
Reference in a new issue