js-kubo-rpc-client icon indicating copy to clipboard operation
js-kubo-rpc-client copied to clipboard

fix: support readable streams as iterable in dag.import

Open SgtPooki opened this issue 9 months ago • 0 comments

https://github.com/ipfs/js-kubo-rpc-client/blob/1ab7941819dd1a48df653ee159e6983608e72132/src/dag/index.ts#L225

Getting the following error in https://github.com/ipfs/ipfs-webui/pull/2323 when using direct kubo-rpc-client types:

Argument of type 'ReadableStream<Uint8Array<ArrayBufferLike>>' is not assignable to parameter of type 'Iterable<Uint8Array<ArrayBufferLike>> | AsyncIterable<Uint8Array<ArrayBufferLike>> | AsyncIterable<...> | Iterable<...>'.ts(2345)

However, readable streams are iterable in most browsers now (safari currently has a bug):

Image

SgtPooki avatar Mar 05 '25 12:03 SgtPooki