github-url-to-object
Advanced tools
Comparing version 3.0.0 to 3.1.0
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
12
2
27529
5
522
1