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

Commit 888e973

Browse files
hugomrdiasJacob Heun
authored and
Jacob Heun
committed
feat: swap quick-lru by hashlru
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.
1 parent 6562463 commit 888e973

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"async": "^2.6.0",
5858
"big.js": "^5.0.3",
5959
"debug": "^3.1.0",
60+
"hashlru": "^2.2.1",
6061
"interface-connection": "~0.3.2",
6162
"ip-address": "^5.8.9",
6263
"libp2p-circuit": "~0.2.0",
@@ -68,8 +69,7 @@
6869
"once": "^1.4.0",
6970
"peer-id": "~0.10.7",
7071
"peer-info": "~0.14.1",
71-
"pull-stream": "^3.6.7",
72-
"quick-lru": "^1.1.0"
72+
"pull-stream": "^3.6.7"
7373
},
7474
"contributors": [
7575
"Alan Shaw <[email protected]>",

src/stats/old-peers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const LRU = require('quick-lru')
3+
const LRU = require('hashlru')
44

55
/**
66
* Creates and returns a Least Recently Used Cache
@@ -9,5 +9,7 @@ const LRU = require('quick-lru')
99
* @returns {LRUCache}
1010
*/
1111
module.exports = (maxSize) => {
12-
return new LRU({ maxSize: maxSize })
12+
const patched = LRU(maxSize)
13+
patched.delete = patched.remove
14+
return patched
1315
}

0 commit comments

Comments
 (0)