Skip to content

Commit

Permalink
fix: length-prefixed stream pass opts to byte stream (#107)
Browse files Browse the repository at this point in the history
To allow controlling unwrapped output pass opts to the underlying
byte stream.
  • Loading branch information
achingbrain committed Nov 22, 2023
1 parent 83198c3 commit 3dfabfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/it-length-prefixed-stream/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const defaultLengthDecoder: lp.LengthDecoderFunction = (buf) => {
defaultLengthDecoder.bytes = 0

export function lpStream <Stream extends Duplex<any, any, any>> (duplex: Stream, opts: Partial<LengthPrefixedStreamOpts> = {}): LengthPrefixedStream<Stream> {
const bytes = byteStream(duplex)
const bytes = byteStream(duplex, opts)

if (opts.maxDataLength != null && opts.maxLengthLength == null) {
// if max data length is set but max length length is not, calculate the
Expand Down

0 comments on commit 3dfabfa

Please sign in to comment.