Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
feat: swap quick-lru by hashlru
Browse files Browse the repository at this point in the history
This removes the only dependency using generators in the ipfs/libp2p ecosystem.
Next version of create-react-app will support ipfs out-of-box with this change.
  • Loading branch information
hugomrdias authored and Jacob Heun committed Jun 6, 2018
1 parent 6562463 commit 888e973
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"async": "^2.6.0",
"big.js": "^5.0.3",
"debug": "^3.1.0",
"hashlru": "^2.2.1",
"interface-connection": "~0.3.2",
"ip-address": "^5.8.9",
"libp2p-circuit": "~0.2.0",
Expand All @@ -68,8 +69,7 @@
"once": "^1.4.0",
"peer-id": "~0.10.7",
"peer-info": "~0.14.1",
"pull-stream": "^3.6.7",
"quick-lru": "^1.1.0"
"pull-stream": "^3.6.7"
},
"contributors": [
"Alan Shaw <alan@tableflip.io>",
Expand Down
6 changes: 4 additions & 2 deletions src/stats/old-peers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const LRU = require('quick-lru')
const LRU = require('hashlru')

/**
* Creates and returns a Least Recently Used Cache
Expand All @@ -9,5 +9,7 @@ const LRU = require('quick-lru')
* @returns {LRUCache}
*/
module.exports = (maxSize) => {
return new LRU({ maxSize: maxSize })
const patched = LRU(maxSize)
patched.delete = patched.remove
return patched
}

0 comments on commit 888e973

Please sign in to comment.