Socket
Socket
Sign inDemoInstall

hosted-git-info

Package Overview
Dependencies
Maintainers
6
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hosted-git-info - npm Package Compare versions

Comparing version 2.8.3 to 3.0.0

15

CHANGELOG.md

@@ -5,2 +5,17 @@ # Change Log

<a name="3.0.0"></a>
# [3.0.0](https://github.com/npm/hosted-git-info/compare/v2.8.3...v3.0.0) (2019-08-12)
### Bug Fixes
* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([37c2891](https://github.com/npm/hosted-git-info/commit/37c2891)), closes [#38](https://github.com/npm/hosted-git-info/issues/38)
### BREAKING CHANGES
* **cache:** Drop support for node 0.x
<a name="2.8.3"></a>

@@ -7,0 +22,0 @@ ## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12)

10

index.js

@@ -5,2 +5,4 @@ 'use strict'

var GitHost = module.exports = require('./git-host.js')
var LRU = require('lru-cache')
var cache = new LRU({max: 1000})

@@ -26,4 +28,2 @@ var protocolToRepresentationMap = {

var cache = {}
module.exports.fromUrl = function (giturl, opts) {

@@ -33,7 +33,7 @@ if (typeof giturl !== 'string') return

if (!(key in cache)) {
cache[key] = fromUrl(giturl, opts)
if (!cache.has(key)) {
cache.set(key, fromUrl(giturl, opts))
}
return cache[key]
return cache.get(key)
}

@@ -40,0 +40,0 @@

{
"name": "hosted-git-info",
"version": "2.8.3",
"version": "3.0.0",
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab",

@@ -29,2 +29,5 @@ "main": "index.js",

},
"dependencies": {
"lru-cache": "^5.1.1"
},
"devDependencies": {

@@ -31,0 +34,0 @@ "standard": "^11.0.1",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc