github-url-from-git
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -6,3 +6,3 @@ // convert git:// form url to github URL, e.g., | ||
try { | ||
var m = re(opts).exec(url.replace(/\.git$/, '')); | ||
var m = re(opts).exec(url.replace(/\.git(#.*)?$/, '')); | ||
var host = m[1]; | ||
@@ -9,0 +9,0 @@ var path = m[2]; |
{ | ||
"name": "github-url-from-git", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Parse a github git url and return the github repo url", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "http://github.com/visionmedia/node-github-url-from-git" | ||
"url": "https://github.com/visionmedia/node-github-url-from-git.git" | ||
}, | ||
@@ -14,0 +14,0 @@ "keywords": [ |
@@ -31,2 +31,17 @@ | ||
it('should parse git@github.com:bcoe/thumbd.git', function() { | ||
var url = 'git@github.com:bcoe/thumbd.git'; | ||
parse(url).should.eql('https://github.com/bcoe/thumbd'); | ||
}) | ||
it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { | ||
var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; | ||
parse(url).should.eql('https://github.com/bcoe/thumbd'); | ||
}) | ||
it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { | ||
var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; | ||
parse(url).should.eql('https://github.com/EastCloud/node-websockets'); | ||
}) | ||
// gist urls. | ||
@@ -33,0 +48,0 @@ |
15
test.js
@@ -30,2 +30,17 @@ var parse = require('./'); | ||
it('should parse git@github.com:bcoe/thumbd.git', function() { | ||
var url = 'git@github.com:bcoe/thumbd.git'; | ||
parse(url).should.eql('https://github.com/bcoe/thumbd'); | ||
}) | ||
it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { | ||
var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; | ||
parse(url).should.eql('https://github.com/bcoe/thumbd'); | ||
}) | ||
it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { | ||
var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; | ||
parse(url).should.eql('https://github.com/EastCloud/node-websockets'); | ||
}) | ||
// gist urls. | ||
@@ -32,0 +47,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8298
94
83
0