Socket
Socket
Sign inDemoInstall

github-url-to-object

Package Overview
Dependencies
1
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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 @@

2

package.json
{
"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 () {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc