npm-registry
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -122,3 +122,3 @@ 'use strict'; | ||
add(normalize.packages(release, data)); | ||
add(normalize.packages(data, release)); | ||
}); | ||
@@ -125,0 +125,0 @@ |
@@ -55,4 +55,4 @@ 'use strict'; | ||
data._id = data.name = data.name || data._id || fallback.name || fallback._id; | ||
data.licenses = fallback.licenses || data.licenses; | ||
data.license = fallback.license || data.license; | ||
data.licenses = to.licenses(data, fallback); | ||
data.github = extract(data); | ||
@@ -59,0 +59,0 @@ data.releases = releases; |
@@ -25,2 +25,28 @@ 'use strict'; | ||
/** | ||
* Decide the best way of merging license data. | ||
* | ||
* @param {Mixed} data | ||
* @param {Mixed} fallback | ||
* @returns {Mixed} The one that should be merged. | ||
*/ | ||
exports.licenses = function licenses(data, fallback) { | ||
var fblicenses = fallback.licenses | ||
, dlicenses = data.licenses | ||
, fbok, dok; | ||
fbok = Array.isArray(fblicenses) && fblicenses.every(function every(license) { | ||
return 'string' === exports.type(license); | ||
}); | ||
dok = Array.isArray(dlicenses) && dlicenses.every(function every(license) { | ||
return 'string' === exports.type(license); | ||
}); | ||
if (dok && !fbok) return dlicenses; | ||
if (fbok && !dok) return fblicenses; | ||
return dlicenses || fblicenses; | ||
}; | ||
/** | ||
* Create a gravatar for the given email. | ||
@@ -27,0 +53,0 @@ * |
{ | ||
"name": "npm-registry", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "An high available npm registry client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31323
819