This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
refactor: export CID instances not strings or buffers #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the exporter to remove the
hash
property and replace it with acid
property in yielded objects.I actually ended up doing this because there's a bug in the "raw" resolver - the objects it yields have a "hash" property not a "multihash" property like file, object and dir. This was causing problems with the CIDv1 base32 work where v1 forces raw leaves and we start using that raw resolver which obviously then gives us back
undefined
when accessing the "multihash" prop.That file probably needs more/better tests.EDIT: added a testThe upshot is that I solve that issue, as well as make progress towards ipfs-inactive/interface-js-ipfs-core#394 and hopefully make some performance gains by not having to do so much conversion between string/buffer/CID. Hooray!