fix return type of getHubs()
This commit is contained in:
parent
c8f8e11c0b
commit
9446faa823
|
@ -71,7 +71,7 @@ function initHubClient(peer, config) {
|
|||
|
||||
/**
|
||||
* @param {number} amount
|
||||
* @param {CB<Array<string>>} cb
|
||||
* @param {CB<Array<`/${string}`>>} cb
|
||||
*/
|
||||
getHubs(amount, cb) {
|
||||
const source = peer.net.peers()
|
||||
|
@ -81,7 +81,9 @@ function initHubClient(peer, config) {
|
|||
if (err) return cb(new Error('Failed to get hubs', { cause: err }))
|
||||
// @ts-ignore
|
||||
const infoMap = /**@type {Map<`/${string}`, Info>}*/ (new Map(peers))
|
||||
const multiaddrs = peer.set.values(HUBS_SUBDOMAIN)
|
||||
const multiaddrs = /**@type {Array<`/${string}`>}*/ (
|
||||
peer.set.values(HUBS_SUBDOMAIN)
|
||||
)
|
||||
const hubs = []
|
||||
for (const multiaddr of multiaddrs) {
|
||||
const stats = infoMap.get(multiaddr)?.stats ?? { failure: 1 }
|
||||
|
|
Loading…
Reference in New Issue