mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
docs: update addressBook get and getMultiaddrsForPeer return values (#716)
This commit is contained in:
parent
7da9ad44ab
commit
cea59a1fe4
@ -760,7 +760,7 @@ Get the known [`Addresses`][address] of a provided peer.
|
|||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|------|-------------|
|
|------|-------------|
|
||||||
| `Array<Address>` | Array of peer's [`Addresses`][address] containing the multiaddr and its metadata |
|
| `Array<Address>|undefined` | Array of peer's [`Addresses`][address] containing the multiaddr and its metadata if available, otherwise undefined |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@ -797,7 +797,7 @@ Get the known `Multiaddr` of a provided peer. All returned multiaddrs will inclu
|
|||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|------|-------------|
|
|------|-------------|
|
||||||
| `Array<Multiaddr>` | Array of peer's multiaddr |
|
| `Array<Multiaddr>|undefined` | Array of peer's multiaddr if available, otherwise undefined |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
|
@ -168,8 +168,9 @@ class AddressBook extends Book {
|
|||||||
/**
|
/**
|
||||||
* Get the known multiaddrs for a given peer. All returned multiaddrs
|
* Get the known multiaddrs for a given peer. All returned multiaddrs
|
||||||
* will include the encapsulated `PeerId` of the peer.
|
* will include the encapsulated `PeerId` of the peer.
|
||||||
|
* Returns `undefined` if there are no known multiaddrs for the given peer.
|
||||||
* @param {PeerId} peerId
|
* @param {PeerId} peerId
|
||||||
* @returns {Array<Multiaddr>}
|
* @returns {Array<Multiaddr>|undefined}
|
||||||
*/
|
*/
|
||||||
getMultiaddrsForPeer (peerId) {
|
getMultiaddrsForPeer (peerId) {
|
||||||
if (!PeerId.isPeerId(peerId)) {
|
if (!PeerId.isPeerId(peerId)) {
|
||||||
|
@ -77,8 +77,9 @@ class Book {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the known data of a provided peer.
|
* Get the known data of a provided peer.
|
||||||
|
* Returns `undefined` if there is no available data for the given peer.
|
||||||
* @param {PeerId} peerId
|
* @param {PeerId} peerId
|
||||||
* @returns {Array<Data>}
|
* @returns {Array<Data>|undefined}
|
||||||
*/
|
*/
|
||||||
get (peerId) {
|
get (peerId) {
|
||||||
if (!PeerId.isPeerId(peerId)) {
|
if (!PeerId.isPeerId(peerId)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user