Skip to content

fix: support readable streams as iterable in dag.import #278

@SgtPooki

Description

@SgtPooki

import(sources: Iterable<Uint8Array> | AsyncIterable<Uint8Array> | AsyncIterable<AsyncIterable<Uint8Array>> | Iterable<AsyncIterable<Uint8Array>>, options?: DAGImportOptions): AsyncIterable<DAGImportResult>

Getting the following error in ipfs/ipfs-webui#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upgood first issueGood issue for new contributorshelp wantedSeeking public contribution on this issuestatus/readyReady to be worked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions