hosted-git-info
Advanced tools
Comparing version 2.1.1 to 2.1.2
18
index.js
@@ -21,3 +21,5 @@ 'use strict' | ||
'https:': true, | ||
'http:': true | ||
'git+https:': true, | ||
'http:': true, | ||
'git+http:': true | ||
} | ||
@@ -38,8 +40,8 @@ | ||
var comittish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null | ||
var host = null | ||
var path = null | ||
var user = null | ||
var project = null | ||
var defaultRepresentation = null | ||
if (parsed.protocol === gitHostName + ':') { | ||
host = decodeURIComponent(parsed.host) | ||
path = decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, '$1')) | ||
user = decodeURIComponent(parsed.host) | ||
project = parsed.path && decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, '$1')) | ||
defaultRepresentation = 'shortcut' | ||
@@ -52,7 +54,7 @@ } else { | ||
if (!matched) return | ||
if (matched[1] != null) host = decodeURIComponent(matched[1]) | ||
if (matched[2] != null) path = decodeURIComponent(matched[2]) | ||
if (matched[1] != null) user = decodeURIComponent(matched[1]) | ||
if (matched[2] != null) project = decodeURIComponent(matched[2]) | ||
defaultRepresentation = protocolToRepresentation(parsed.protocol) | ||
} | ||
return new GitHost(gitHostName, host, auth, path, comittish, defaultRepresentation) | ||
return new GitHost(gitHostName, user, auth, project, comittish, defaultRepresentation) | ||
}).filter(function (gitHostInfo) { return gitHostInfo }) | ||
@@ -59,0 +61,0 @@ if (matches.length !== 1) return |
{ | ||
"name": "hosted-git-info", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
24002
15
445
0