ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

[Types] DAGAPI get requires CID but should also be `string|Uint8Array`? #3637

Closed rvagg closed 3 years ago

rvagg commented 3 years ago

Ref: https://github.com/ceramicnetwork/js-ceramic/pull/1194#discussion_r606629195

https://github.com/ipfs/js-ipfs/blob/63b11e5ac9d0b36d89ec23966e4523721878a7c0/packages/ipfs-core-types/src/dag/index.d.ts#L51

->

https://github.com/ipfs/js-ipfs/blob/63b11e5ac9d0b36d89ec23966e4523721878a7c0/packages/ipfs-core/src/components/dag/get.js#L14-L21

But toCidAndPath() still allows string and Uint8Array:

https://github.com/ipfs/js-ipfs/blob/63b11e5ac9d0b36d89ec23966e4523721878a7c0/packages/ipfs-core-utils/src/to-cid-and-path.js#L8-L12

CSDUMMI commented 3 years ago

What is the problem here? Why do you have to remove string support? By the issues, I cannot gather any reason for this change and it causes errors in orbit-db.