Conversation
Replaces cids and multibase with the new multiformats module. BREAKING CHANGE: uses the CID class from the new multiformats module
| "test:node": "aegir test --ts -t node", | ||
| "test:browser": "aegir test -t browser", | ||
| "build": "aegir build", | ||
| "prepare": "aegir build", |
There was a problem hiding this comment.
Without this you can't depend on a branch of this repo as otherwise it has no types after install. prepare is run during release so it shouldn't break anything?
There was a problem hiding this comment.
We can keep it, but I would not remove the build script. Perhaps just add a new one?
There was a problem hiding this comment.
Can do, but then it'll build twice during release since npm runs prepare and aegir runs build
src/convert.js
Outdated
| function mh2bytes (hash) { | ||
| let cid | ||
|
|
||
| if (typeof hash === 'string') { |
There was a problem hiding this comment.
We have this same logic in PeerId as well. Thinking if cid could offer a way of doing it?
There was a problem hiding this comment.
Could probably add it to CID.asCID, though I think that's supposed to convert between old and new CID instances, not try to parse whatever we throw at it. This is quite a common use case though.
There was a problem hiding this comment.
This is quite a common use case though
Can we export an util static function for this in multiformats then?
vasco-santos
left a comment
There was a problem hiding this comment.
LGTM! Let me know when we have all the other PRs ready, as this will need to ship and also has its version updated everywhere given the breaking change CID
Replaces cids and multibase with the new multiformats module.
BREAKING CHANGE: uses the CID class from the new multiformats module