license-checker
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -12,2 +12,3 @@ /* | ||
csv: Boolean, | ||
markdown: Boolean, | ||
out: require('path'), | ||
@@ -14,0 +15,0 @@ unknown: Boolean, |
@@ -40,3 +40,4 @@ | ||
if (typeof json.repository === 'object' && typeof json.repository.url === 'string') { | ||
moduleInfo.repository = json.repository.url.replace('git://github.com', 'https://github.com').replace('.git', ''); | ||
moduleInfo.repository = json.repository.url.replace('git+ssh://git@', 'git://').replace('.git', ''); | ||
moduleInfo.repository = moduleInfo.repository.replace('git://github.com', 'https://github.com').replace('.git', ''); | ||
moduleInfo.repository = moduleInfo.repository.replace('git@github.com:', 'https://github.com/').replace('.git', ''); | ||
@@ -169,1 +170,10 @@ } | ||
}; | ||
exports.asMarkDown = function(sorted) { | ||
var text = []; | ||
Object.keys(sorted).forEach(function(key) { | ||
var module = sorted[key]; | ||
text.push('[' + key + '](' + module.repository + ') - ' + module.licenses); | ||
}); | ||
return text.join('\n'); | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "chalk": "~0.5.1", |
@@ -30,3 +30,3 @@ var vows = require('vows'), | ||
assert.isTrue(Object.keys(d).length > 70); | ||
assert.equal(d['abbrev@1.0.5'].licenses, 'MIT'); | ||
assert.equal(d['abbrev@1.0.7'].licenses, 'ISC'); | ||
}, | ||
@@ -36,4 +36,8 @@ 'and convert to CSV': function(d) { | ||
assert.equal('"module name","license","repository"', str.split('\n')[0]); | ||
assert.equal('"abbrev@1.0.5","MIT","http://github.com/isaacs/abbrev-js"', str.split('\n')[1]); | ||
assert.equal('"abbrev@1.0.7","ISC","https://github.com/isaacs/abbrev-js"', str.split('\n')[1]); | ||
}, | ||
'and convert to MarkDown': function(d) { | ||
var str = checker.asMarkDown(d); | ||
assert.equal('[abbrev@1.0.7](https://github.com/isaacs/abbrev-js) - ISC', str.split('\n')[0]); | ||
}, | ||
'should parse local without unknown': { | ||
@@ -40,0 +44,0 @@ topic: function () { |
Sorry, the diff of this file is not supported yet
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
17703
348