Skip to content

Commit

Permalink
fix: allow passing undefined to reader next method (#14)
Browse files Browse the repository at this point in the history
The `bytes` value is optional and null-guarded so we can accept undefined as a value.
  • Loading branch information
achingbrain authored Mar 8, 2022
1 parent 991addd commit 9944de0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Uint8ArrayList } from 'uint8arraylist'
import type { Source } from 'it-stream-types'

export interface Reader extends AsyncGenerator<Uint8ArrayList, void, any> {
next: (...args: [] | [number]) => Promise<IteratorResult<Uint8ArrayList, void>>
next: (...args: [] | [number | undefined]) => Promise<IteratorResult<Uint8ArrayList, void>>
}

export function reader (source: Source<Uint8Array>) {
Expand Down

0 comments on commit 9944de0

Please sign in to comment.