-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add toJSON? #54
Comments
isn't that what you get from toString()? |
yes, should the JSON representation be the same? |
Not sure. JSON can provide more information than a String, i.e it could have a toJSON that already divided the multiaddr into tuples |
There's no info missing in the string representation though...other than "I am a multiaddr", but neither representation says this atm. Right now multiaddr(JSON.parse(JSON.stringify(multiaddr('/ip4/127.0.0.1')))) Of note, if you give a multiaddr to IPFS config then bad things happen because a stringified multiaddr is saved to a JSON config file and read out as something it's not. new IPFS({
config: {
Addresses: { Swarm: [multiaddr('...')] }
}
}) |
Added in 6.0.6 |
If I
JSON.stringify(multiaddr('/ip4/127.0.0.1'))
I get"{\"buffer\":{\"type\":\"Buffer\",\"data\":[4,127,0,0,1]}}"
should it be '/ip4/127.0.0.1' instead?The text was updated successfully, but these errors were encountered: