Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit b50039d

Browse files
authored
fix: remove p-map dependency (#335)
1 parent dd18ac5 commit b50039d

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@
159159
"k-bucket": "^5.1.0",
160160
"multiformats": "^9.6.3",
161161
"p-defer": "^4.0.0",
162-
"p-map": "^5.3.0",
163162
"p-queue": "^7.2.0",
164163
"private-ip": "^2.3.3",
165164
"protons-runtime": "^1.0.4",

src/peer-list/peer-distance-list.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as utils from '../utils.js'
2-
import pMap from 'p-map'
32
import { compare as uint8ArrayCompare } from 'uint8arrays/compare'
43
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
54
import type { PeerId } from '@libp2p/interfaces/peer-id'
@@ -77,7 +76,7 @@ export class PeerDistanceList {
7776
return true
7877
}
7978

80-
const dhtKeys = await pMap(peerIds, async (peerId) => await utils.convertPeerId(peerId))
79+
const dhtKeys = await Promise.all(peerIds.map(utils.convertPeerId))
8180
const furthestDistance = this.peerDistances[this.peerDistances.length - 1].distance
8281

8382
for (const dhtKey of dhtKeys) {

0 commit comments

Comments
 (0)