hosted-git-info
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -6,5 +6,19 @@ 'use strict' | ||
const parseUrl = require('./parse-url.js') | ||
const protocols = require('./protocols')(gitHosts.byShortcut) | ||
const cache = new LRU({ max: 1000 }) | ||
const protocols = { | ||
'git+ssh:': { name: 'sshurl' }, | ||
'ssh:': { name: 'sshurl' }, | ||
'git+https:': { name: 'https', auth: true }, | ||
'git:': { auth: true }, | ||
'http:': { auth: true }, | ||
'https:': { auth: true }, | ||
'git+http:': { auth: true }, | ||
...Object.keys(gitHosts.byShortcut).reduce((acc, key) => { | ||
acc[key] = { name: gitHosts.byShortcut[key] } | ||
return acc | ||
}, {}), | ||
} | ||
module.exports.fromUrl = function (giturl, opts) { | ||
@@ -11,0 +25,0 @@ if (typeof giturl !== 'string') { |
const url = require('url') | ||
const getProtocols = require('./protocols.js') | ||
@@ -76,5 +75,5 @@ const lastIndexOfBefore = (str, char, beforeChar) => { | ||
module.exports = (giturl, protocols = getProtocols()) => { | ||
const withProtocol = correctProtocol(giturl, protocols) | ||
module.exports = (giturl, protocols) => { | ||
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl | ||
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol)) | ||
} |
{ | ||
"name": "hosted-git-info", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", | ||
@@ -5,0 +5,0 @@ "main": "./lib/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
25826
7
459