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

Commit

Permalink
fix: remove p-map dependency (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
abetaev authored May 16, 2022
1 parent dd18ac5 commit b50039d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
"k-bucket": "^5.1.0",
"multiformats": "^9.6.3",
"p-defer": "^4.0.0",
"p-map": "^5.3.0",
"p-queue": "^7.2.0",
"private-ip": "^2.3.3",
"protons-runtime": "^1.0.4",
Expand Down
3 changes: 1 addition & 2 deletions src/peer-list/peer-distance-list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as utils from '../utils.js'
import pMap from 'p-map'
import { compare as uint8ArrayCompare } from 'uint8arrays/compare'
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
import type { PeerId } from '@libp2p/interfaces/peer-id'
Expand Down Expand Up @@ -77,7 +76,7 @@ export class PeerDistanceList {
return true
}

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

for (const dhtKey of dhtKeys) {
Expand Down

0 comments on commit b50039d

Please sign in to comment.