github-url-to-object
Advanced tools
Comparing version 1.5.3 to 1.6.0
@@ -34,3 +34,3 @@ 'use strict' | ||
var parsedURL = url.parse(repo_url) | ||
if (!parsedURL.hostname) return null | ||
@@ -58,5 +58,7 @@ if (parsedURL.hostname !== 'github.com') return null | ||
obj.travis_url = util.format('https://travis-ci.org/%s/%s', obj.user, obj.repo) | ||
obj.zip_url = util.format('https://github.com/%s/%s/archive/master.zip', obj.user, obj.repo) | ||
} else { | ||
obj.https_url = util.format('https://github.com/%s/%s/tree/%s', 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://github.com/%s/%s/archive/%s.zip', obj.user, obj.repo, obj.branch) | ||
} | ||
@@ -63,0 +65,0 @@ |
{ | ||
"name": "github-url-to-object", | ||
"version": "1.5.3", | ||
"version": "1.6.0", | ||
"description": "Extract user, repo, and other interesting properties from GitHub URLs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,3 @@ # github-url-to-object [![Build Status](https://travis-ci.org/zeke/github-url-to-object.png?branch=master)](https://travis-ci.org/zeke/github-url-to-object) | ||
api_url: 'https://api.github.com/repos/monkey/business' | ||
zip_url: 'https://github.com/monkey/business/archive/master.zip' | ||
} | ||
@@ -68,2 +69,3 @@ ``` | ||
api_url: 'https://api.github.com/repos/monkey/business' | ||
zip_url: 'https://github.com/monkey/business/archive/nachos.zip' | ||
} | ||
@@ -70,0 +72,0 @@ ``` |
@@ -176,2 +176,6 @@ /* globals before, describe, it */ | ||
it('zip_url', function () { | ||
assert.equal(obj.zip_url, 'https://github.com/zeke/ord/archive/master.zip') | ||
}) | ||
}) | ||
@@ -202,2 +206,6 @@ | ||
it('applies to zip_url', function () { | ||
assert.equal(obj.zip_url, 'https://github.com/zeke/ord/archive/experiment.zip') | ||
}) | ||
}) | ||
@@ -204,0 +212,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
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
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
15289
251
86
1