Skip to content

Commit 0bb612d

Browse files
authored
fix: update import types (#164)
This module supports more than just `AsyncIterable<Uint8Array>`
1 parent 84ecce0 commit 0bb612d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/ipfs-unixfs-exporter/test/importer.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ strategies.forEach((strategy) => {
392392

393393
it('fails on an iterator that yields bad content', async () => {
394394
try {
395+
// @ts-expect-error bad content
395396
await all(importer([{
396397
path: '200Bytes.txt',
397398
content: {
398-
// @ts-expect-error bad content
399399
[Symbol.iterator]: function * () {
400400
yield 7
401401
}

packages/ipfs-unixfs-importer/src/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Blockstore } from 'interface-blockstore'
66

77
interface ImportCandidate {
88
path?: string
9-
content?: AsyncIterable<Uint8Array>
9+
content?: AsyncIterable<Uint8Array> | Iterable<Uint8Array> | Uint8Array
1010
mtime?: Mtime
1111
mode?: number
1212
}

0 commit comments

Comments
 (0)