Skip to content

Commit

Permalink
give empty default to opts
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Oct 4, 2022
1 parent 7b0ff52 commit 96cd112
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ export class InboundStream {
private readonly rawStream: Stream
private readonly closeController: AbortController

constructor(rawStream: Stream, opts: InboundStreamOpts) {
constructor(rawStream: Stream, opts: InboundStreamOpts = {}) {
this.rawStream = rawStream
this.closeController = new AbortController()

this.source = abortableSource(pipe(this.rawStream, decode(opts)), this.closeController.signal, { returnOnAbort: true })
this.source = abortableSource(pipe(this.rawStream, decode(opts)), this.closeController.signal, {
returnOnAbort: true
})
}

close(): void {
Expand Down

0 comments on commit 96cd112

Please sign in to comment.