mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-28 08:21:33 +00:00
chore: add types checker script and more fixes on the jsdocs
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
'use strict'
|
||||
|
||||
const errCode = require('err-code')
|
||||
const debug = require('debug')
|
||||
const log = debug('libp2p:peer-routing')
|
||||
log.error = debug('libp2p:peer-routing:error')
|
||||
const log = Object.assign(debug('libp2p:peer-routing'), {
|
||||
error: debug('libp2p:peer-routing:err')
|
||||
})
|
||||
const errCode = require('err-code')
|
||||
|
||||
const all = require('it-all')
|
||||
const pAny = require('p-any')
|
||||
@ -69,7 +70,6 @@ class PeerRouting {
|
||||
clearDelayedInterval(this._timeoutId)
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* Iterates over all peer routers in series to find the given peer.
|
||||
*
|
||||
@ -89,20 +89,6 @@ class PeerRouting {
|
||||
// If we don't have a result, we need to provide an error to keep trying
|
||||
if (!result || Object.keys(result).length === 0) {
|
||||
throw errCode(new Error('not found'), 'NOT_FOUND')
|
||||
=======
|
||||
return {
|
||||
/**
|
||||
* Iterates over all peer routers in series to find the given peer.
|
||||
*
|
||||
* @param {string} id - The id of the peer to find
|
||||
* @param {object} [options]
|
||||
* @param {number} [options.timeout] - How long the query should run
|
||||
* @returns {Promise<{ id: PeerId, multiaddrs: Multiaddr[] }>}
|
||||
*/
|
||||
findPeer: async (id, options) => { // eslint-disable-line require-await
|
||||
if (!routers.length) {
|
||||
throw errCode(new Error('No peer routers available'), 'NO_ROUTERS_AVAILABLE')
|
||||
>>>>>>> chore: address review
|
||||
}
|
||||
|
||||
return result
|
||||
|
Reference in New Issue
Block a user