You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds `peerMultiaddr` check for easy validation of IPFS peer
addresses.
It is a think wrapper on top of generic `multiaddr` check
coupled with `mafmt.IPFS.matches(multiaddr)`
Details behind `mafmt.IPFS` can be found at
https://github.com/multiformats/js-mafmt#api
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@@ -121,7 +126,7 @@ Returns `true` if the provided string is a valid `multihash` or `false` otherwis
121
126
122
127
### `isIPFS.cid(hash)`
123
128
124
-
Returns `true` if the provided string or [`CID`](https://github.com/ipld/js-cid)is a valid [CID](https://docs.ipfs.io/guides/concepts/cid/) or `false` otherwise.
129
+
Returns `true` if the provided string or [`CID`](https://github.com/ipld/js-cid)represents a valid [CID](https://docs.ipfs.io/guides/concepts/cid/) or `false` otherwise.
125
130
126
131
### `isIPFS.base32cid(hash)`
127
132
@@ -182,7 +187,11 @@ Returns `true` if the provided string includes a valid IPNS subdomain or `false`
182
187
183
188
### `isIPFS.multiaddr(addr)`
184
189
185
-
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Buffer` includes a valid [multiaddr](https://multiformats.io/multiaddr/) or `false` otherwise.
190
+
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Buffer` represents a valid [multiaddr](https://multiformats.io/multiaddr/) or `false` otherwise.
191
+
192
+
### `isIPFS.peerMultiaddr(addr)`
193
+
194
+
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Buffer` represents a valid "IPFS Peer" multiaddr (matching [`IPFS` format from `mafmt`](https://github.com/multiformats/js-mafmt#api)) or `false` otherwise.
0 commit comments