chore: apply suggestions from code review

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Vasco Santos 2020-07-22 16:19:40 +02:00 committed by Jacob Heun
parent f574e82a5d
commit ca57e65ecc

View File

@ -125,9 +125,10 @@ class AddressBook extends Book {
}
/**
* Get a peer raw envelope.
* Get the raw Envelope for a peer. Returns
* undefined if no Envelope is found.
* @param {PeerId} peerId
* @return {Buffer}
* @return {Buffer|undefined}
*/
getRawEnvelope (peerId) {
const entry = this.data.get(peerId.toB58String())
@ -141,8 +142,9 @@ class AddressBook extends Book {
/**
* Get an Envelope containing a PeerRecord for the given peer.
* Returns undefined if no record exists.
* @param {PeerId} peerId
* @return {Promise<Envelope>}
* @return {Promise<Envelope|void>}
*/
getPeerRecord (peerId) {
const raw = this.getRawEnvelope(peerId)