hosted-git-info
Advanced tools
Comparing version 2.8.2 to 2.8.3
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="2.8.3"></a> | ||
## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) | ||
<a name="2.8.2"></a> | ||
@@ -7,0 +12,0 @@ ## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) |
10
index.js
@@ -5,4 +5,2 @@ 'use strict' | ||
var GitHost = module.exports = require('./git-host.js') | ||
var LRU = require('lru-cache') | ||
var cache = new LRU({max: 1000}) | ||
@@ -28,2 +26,4 @@ var protocolToRepresentationMap = { | ||
var cache = {} | ||
module.exports.fromUrl = function (giturl, opts) { | ||
@@ -33,7 +33,7 @@ if (typeof giturl !== 'string') return | ||
if (!cache.has(key)) { | ||
cache.set(key, fromUrl(giturl, opts)) | ||
if (!(key in cache)) { | ||
cache[key] = fromUrl(giturl, opts) | ||
} | ||
return cache.get(key) | ||
return cache[key] | ||
} | ||
@@ -40,0 +40,0 @@ |
{ | ||
"name": "hosted-git-info", | ||
"version": "2.8.2", | ||
"version": "2.8.3", | ||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", | ||
@@ -29,5 +29,2 @@ "main": "index.js", | ||
}, | ||
"dependencies": { | ||
"lru-cache": "^5.1.1" | ||
}, | ||
"devDependencies": { | ||
@@ -34,0 +31,0 @@ "standard": "^11.0.1", |
22552
0
326
- Removedlru-cache@^5.1.1
- Removedlru-cache@5.1.1(transitive)
- Removedyallist@3.1.1(transitive)