github-url-to-object
Advanced tools
Comparing version 2.2.6 to 3.0.0
@@ -13,2 +13,6 @@ 'use strict' | ||
// Allow an object with nested `url` string | ||
// (common practice in package.json files) | ||
if (repoUrl.url) repoUrl = repoUrl.url | ||
var shorthand = repoUrl.match(/^([\w-_]+)\/([\w-_\.]+)#?([\w-_\.]+)?$/) | ||
@@ -15,0 +19,0 @@ var mediumhand = repoUrl.match(/^github:([\w-_]+)\/([\w-_\.]+)#?([\w-_\.]+)?$/) |
{ | ||
"name": "github-url-to-object", | ||
"version": "2.2.6", | ||
"version": "3.0.0", | ||
"description": "Extract user, repo, and other interesting properties from GitHub URLs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -100,2 +100,10 @@ /* globals before, describe, it */ | ||
describe('repository.url object', function () { | ||
it('accepts an object with a `url` property; common in package.json files', function () { | ||
var obj = gh({url: 'http://github.com/zeke/outlet.git', type: 'git'}) | ||
assert.equal(obj.user, 'zeke') | ||
assert.equal(obj.repo, 'outlet') | ||
}) | ||
}) | ||
describe('http', function () { | ||
@@ -102,0 +110,0 @@ it('supports http URLs', function () { |
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
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
90109
2430