Skip to content

Commit

Permalink
fix: update import types (#164)
Browse files Browse the repository at this point in the history
This module supports more than just `AsyncIterable<Uint8Array>`
  • Loading branch information
achingbrain authored Aug 3, 2021
1 parent 84ecce0 commit 0bb612d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ipfs-unixfs-exporter/test/importer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ strategies.forEach((strategy) => {

it('fails on an iterator that yields bad content', async () => {
try {
// @ts-expect-error bad content
await all(importer([{
path: '200Bytes.txt',
content: {
// @ts-expect-error bad content
[Symbol.iterator]: function * () {
yield 7
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-unixfs-importer/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Blockstore } from 'interface-blockstore'

interface ImportCandidate {
path?: string
content?: AsyncIterable<Uint8Array>
content?: AsyncIterable<Uint8Array> | Iterable<Uint8Array> | Uint8Array
mtime?: Mtime
mode?: number
}
Expand Down

0 comments on commit 0bb612d

Please sign in to comment.