Socket
Socket
Sign inDemoInstall

github-url-to-object

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-url-to-object - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

dist/commonjs.js

21

index.js
'use strict'
var url = require('url')
var util = require('util')
var isUrl = require('is-url')

@@ -69,16 +68,16 @@

} else {
obj.apiHost = util.format('%s/api/v3', obj.host)
obj.apiHost = `${obj.host}/api/v3`
}
obj.tarball_url = util.format('https://%s/repos/%s/%s/tarball/%s', obj.apiHost, obj.user, obj.repo, obj.branch)
obj.clone_url = util.format('https://%s/%s/%s', obj.host, obj.user, obj.repo)
obj.tarball_url = `https://${obj.apiHost}/repos/${obj.user}/${obj.repo}/tarball/${obj.branch}`
obj.clone_url = `https://${obj.host}/${obj.user}/${obj.repo}`
if (obj.branch === 'master') {
obj.https_url = util.format('https://%s/%s/%s', obj.host, obj.user, obj.repo)
obj.travis_url = util.format('https://travis-ci.org/%s/%s', obj.user, obj.repo)
obj.zip_url = util.format('https://%s/%s/%s/archive/master.zip', obj.host, obj.user, obj.repo)
obj.https_url = `https://${obj.host}/${obj.user}/${obj.repo}`
obj.travis_url = `https://travis-ci.org/${obj.user}/${obj.repo}`
obj.zip_url = `https://${obj.host}/${obj.user}/${obj.repo}/archive/master.zip`
} else {
obj.https_url = util.format('https://%s/%s/%s/blob/%s', obj.host, obj.user, obj.repo, obj.branch)
obj.travis_url = util.format('https://travis-ci.org/%s/%s?branch=%s', obj.user, obj.repo, obj.branch)
obj.zip_url = util.format('https://%s/%s/%s/archive/%s.zip', obj.host, obj.user, obj.repo, obj.branch)
obj.https_url = `https://${obj.host}/${obj.user}/${obj.repo}/blob/${obj.branch}`
obj.travis_url = `https://travis-ci.org/${obj.user}/${obj.repo}?branch=${obj.branch}`
obj.zip_url = `https://${obj.host}/${obj.user}/${obj.repo}/archive/${obj.branch}.zip`
}

@@ -91,5 +90,5 @@

obj.api_url = util.format('https://%s/repos/%s/%s', obj.apiHost, obj.user, obj.repo)
obj.api_url = `https://${obj.apiHost}/repos/${obj.user}/${obj.repo}`
return obj
}
{
"name": "github-url-to-object",
"version": "3.0.0",
"version": "3.1.0",
"description": "Extract user, repo, and other interesting properties from GitHub URLs",
"main": "index.js",
"main": "dist/commonjs.js",
"scripts": {
"test": "mocha && standard",
"build": "browserify index.js --standalone gh > dist/gh.js",
"build": "browserify index.js --standalone gh | buble > dist/gh.js; buble index.js > dist/commonjs.js",
"deploy": "npm run build && git subtree push --prefix dist origin gh-pages && open https://zeke.github.io/github-url-to-object"

@@ -26,2 +26,5 @@ },

},
"browser": {
"url": "./url-browser"
},
"dependencies": {

@@ -32,2 +35,3 @@ "is-url": "^1.1.0"

"browserify": "^13.0.1",
"buble": "^0.15.2",
"mocha": "^2.5.3",

@@ -34,0 +38,0 @@ "standard": "^7.1.2",

/* globals before, describe, it */
var assert = require('assert')
var gh = require('../index')
var gh = require('..')

@@ -6,0 +6,0 @@ describe('github-url-to-object', function () {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc