Socket
Socket
Sign inDemoInstall

hosted-git-info

Package Overview
Dependencies
1
Maintainers
5
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.1.0 to 6.1.1

11

lib/index.js

@@ -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) {

5

lib/parse-url.js
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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc