hosted-git-info
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -7,3 +7,2 @@ 'use strict' | ||
const parseUrl = require('./parse-url.js') | ||
const getProtocols = require('./protocols.js') | ||
@@ -26,3 +25,11 @@ const cache = new LRU({ max: 1000 }) | ||
static #gitHosts = { byShortcut: {}, byDomain: {} } | ||
static #protocols = getProtocols() | ||
static #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 }, | ||
} | ||
@@ -29,0 +36,0 @@ static addHost (name, host) { |
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": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
26590
7
513