github-url-to-object
Advanced tools
Comparing version 2.2.4 to 2.2.5
10
index.js
@@ -50,3 +50,6 @@ 'use strict' | ||
if (parts[3]) { | ||
if (parts[3] && /^\/tree\/master\//.test(parts[3])) { | ||
obj.branch = 'master' | ||
obj.path = parts[3].replace(/\/$/, '') | ||
} else if (parts[3]) { | ||
obj.branch = parts[3].replace(/^\/tree\//, '').match(/[\w-_.]+\/{0,1}[\w-_]+/)[0] | ||
@@ -79,2 +82,7 @@ } else if (parts[4]) { | ||
// Support deep paths (like lerna-style repos) | ||
if (obj.path) { | ||
obj.https_url += obj.path | ||
} | ||
obj.api_url = util.format('https://%s/repos/%s/%s', obj.apiHost, obj.user, obj.repo) | ||
@@ -81,0 +89,0 @@ |
{ | ||
"name": "github-url-to-object", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "Extract user, repo, and other interesting properties from GitHub URLs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -156,2 +156,7 @@ /* globals before, describe, it */ | ||
it('supports nested packages (lerna-style)', function () { | ||
var obj = gh('https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread/') | ||
assert.equal(obj.https_url, 'https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread') | ||
}) | ||
describe('github enterprise', function () { | ||
@@ -158,0 +163,0 @@ it('supports http URLs', function () { |
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
86908
2356