chore: add types checker script and more fixes on the jsdocs

This commit is contained in:
Vasco Santos
2020-11-26 19:16:35 +01:00
parent 7e05c4a43b
commit 28b9f8562c
37 changed files with 246 additions and 165 deletions

View File

@ -7,7 +7,6 @@ const errCode = require('err-code')
const { codes } = require('./errors')
/**
* @typedef {import('peer-id')} PeerId
* @typedef {import('multiaddr')} Multiaddr
*/
@ -16,7 +15,7 @@ const { codes } = require('./errors')
* If a multiaddr is received, the addressBook is updated.
*
* @param {PeerId|multiaddr|string} peer
* @returns {{ id: PeerId, multiaddrs: Multiaddr[] }}
* @returns {{ id: PeerId, multiaddrs: Multiaddr[]|undefined }}
*/
function getPeer (peer) {
if (typeof peer === 'string') {