snyk-module
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -24,3 +24,3 @@ module.exports = moduleToObject; | ||
// first try with regular git urls | ||
var gitObject = looksLikeUrl(str); | ||
@@ -40,2 +40,10 @@ if (gitObject) { | ||
// then as a backup, try pkg@giturl | ||
gitObject = parts[1] && looksLikeUrl(parts[1]); | ||
if (gitObject) { | ||
// then the string looks like a url, let's try to parse it | ||
return supported(str, fromGitObject(gitObject, parts[0])); | ||
} | ||
if (parts.length === 1) { // no version | ||
@@ -42,0 +50,0 @@ parts.push('*'); |
@@ -18,9 +18,17 @@ { | ||
}, | ||
"config": { | ||
"ghooks": { | ||
"commit-msg": "validate-commit-msg", | ||
"pre-push": "npm test" | ||
} | ||
}, | ||
"author": "Remy Sharp", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"ghooks": "^1.0.3", | ||
"jscs": "^2.8.0", | ||
"semantic-release": "^4.3.5", | ||
"snyk": "^1.1.0", | ||
"tap": "^5.0.1" | ||
"tap": "^5.0.1", | ||
"validate-commit-message": "^3.0.1" | ||
}, | ||
@@ -32,3 +40,3 @@ "dependencies": { | ||
}, | ||
"version": "1.4.0" | ||
"version": "1.5.0" | ||
} |
@@ -13,4 +13,2 @@ var test = require('tap').test; | ||
t.deepEqual(mod('@remy/snyk-module'), { name: '@remy/snyk-module', version: '*' }, 'private packages'); | ||
t.deepEqual(mod('jsbin/jsbin'), { name: 'jsbin', version: 'jsbin/jsbin' }, 'short github works'); | ||
t.deepEqual(mod('jsbin', 1), { name: 'jsbin', version: '1' }, 'version arg works'); | ||
@@ -35,2 +33,10 @@ t.deepEqual(mod('@remy/jsbin', 1), { name: '@remy/jsbin', version: '1' }, 'scoped with version arg works'); | ||
urls = urls.reduce(function (acc, curr) { | ||
acc.push(curr); | ||
if (curr.indexOf('@') === -1) { | ||
acc.push('undefsafe@' + curr); | ||
} | ||
return acc; | ||
}, []); | ||
var expect = { | ||
@@ -42,5 +48,7 @@ name: 'undefsafe', | ||
urls.forEach(function (url) { | ||
t.deepEqual(mod(url), expect, 'short github works'); | ||
t.deepEqual(mod(url), expect, url + ' works'); | ||
}); | ||
t.deepEqual(mod('jsbin/jsbin'), { name: 'jsbin', version: 'jsbin/jsbin' }, 'short github works'); | ||
t.deepEqual(mod(urls[0] + '#123'), { name: 'undefsafe', version: 'remy/undefsafe#123'}, 'add hash correctly'); | ||
@@ -62,6 +70,9 @@ | ||
// usernames on git urls aren't supported (unsure if this is 100% right tho) | ||
t.throws(function () { | ||
mod('grunt-sails-linker@git://github.com/Zolmeister/grunt-sails-linker.git'); | ||
}, /not supported: external module/, 'external not supported'); | ||
// pkg names | ||
t.deepEqual( | ||
mod('grunt-sails-linker@git://github.com/Zolmeister/grunt-sails-linker.git'), | ||
{ | ||
name: 'grunt-sails-linker', | ||
version: 'Zolmeister/grunt-sails-linker' | ||
}, 'package + giturl as version works'); | ||
@@ -68,0 +79,0 @@ // privately hosted git repo not supported |
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
9074
178
6