This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
ipfs.add should always return same type #79
Labels
Comments
victorb
changed the title
ipfs.add should return always return same type
ipfs.add should always return same type
Oct 19, 2015
👍 |
I see now that |
with the update to 0.3.8, IPFS started returning ndjson on the HTTP API instead of a JSON array, we need to update that on the node-ipfs-api |
@victorbjelkholm can you confirm if this is still a problem this? The distinction between a stream and an object comes from go-ipfs itself, depending how the header is set: https://github.com/ipfs/js-ipfs-api/blob/master/src/request-api.js#L63-L64 |
According to the tests this should now happen, and will be available for everyone when ipfs/kubo#1979 is merged and released. @victorbjelkholm can you confirm please? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ipfs.add
have a kind of confused API (the same with some other methods), that it's sometimes returning a stream and sometimes an object. I think this is because of the environment but we should try to make sure that inside the callback, users don't have to try to figure out what type it is, it should always be the same type.Will also help simplifying the tests for browser/node environments.
The text was updated successfully, but these errors were encountered: