Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: do not accept single items for ipfs.add #3900

Merged
merged 5 commits into from
Sep 29, 2021

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 27, 2021

The types allow passing single items to ipfs.addAll and multiple items
to ipfs.add.

Instead, only accept single items to ipfs.add and streams of item to
ipfs.addAll and fail with a more helpful error message if you do not
do this.

BREAKING CHANGE: errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)

@achingbrain achingbrain linked an issue Sep 28, 2021 that may be closed by this pull request
The types allow passing single items to `ipfs.addAll` and multiple items
to `ipfs.add`.

Instead, only accept single items to `ipfs.add` and streams of item to
`ipfs.addAll` and fail with a more helpful error message if you do not
do this.
@achingbrain achingbrain force-pushed the fix/do-not-accept-single-items-for-ipfs-add branch from 0887fdb to a86b1be Compare September 28, 2021 18:32
@achingbrain achingbrain merged commit 04e3cf3 into master Sep 29, 2021
@achingbrain achingbrain deleted the fix/do-not-accept-single-items-for-ipfs-add branch September 29, 2021 09:11
SgtPooki referenced this pull request in ipfs/js-kubo-rpc-client Aug 18, 2022
The types allow passing single items to `ipfs.addAll` and multiple items
to `ipfs.add`.

Instead, only accept single items to `ipfs.add` and streams of item to
`ipfs.addAll` and fail with a more helpful error message if you do not
do this.

BREAKING CHANGE: errors will now be thrown if multiple items are passed to `ipfs.add` or single items to `ipfs.addAll` (n.b. you can still pass a list of a single item to `ipfs.addAll`)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipfs.add vs ipfs.addAll input types
1 participant