mirror of
https://github.com/fluencelabs/js-multiaddr-to-uri
synced 2024-12-04 11:30:27 +00:00
fix: add all protocols
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
parent
ac2d98c49a
commit
7fbb65a470
6
index.js
6
index.js
@ -4,9 +4,9 @@ const reduceValue = (_, v) => v
|
||||
const Reducers = {
|
||||
ip4: reduceValue,
|
||||
ip6: (str, content, i, parts) => (
|
||||
parts.some(p => ['tcp', 'udp', 'http', 'https', 'ws', 'wss'].includes(p.protocol))
|
||||
? `[${content}]`
|
||||
: content
|
||||
parts.length === 1 && parts[0].protocol === 'ip6'
|
||||
? content
|
||||
: `[${content}]`
|
||||
),
|
||||
tcp: (str, content, i, parts) => (
|
||||
parts.some(p => ['http', 'https', 'ws', 'wss'].includes(p.protocol))
|
||||
|
Loading…
Reference in New Issue
Block a user