Skip to content

Commit 622f73f

Browse files
committed
Add ability to specify packr, #32
1 parent daf3ac9 commit 622f73f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stream.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class PackrStream extends Transform {
1010
options.writableObjectMode = true
1111
super(options)
1212
options.sequential = true
13-
this.packr = new Packr(options)
13+
this.packr = options.packr || new Packr(options)
1414
}
1515
_transform(value, encoding, callback) {
1616
this.push(this.packr.pack(value))
@@ -25,7 +25,7 @@ export class UnpackrStream extends Transform {
2525
options.objectMode = true
2626
super(options)
2727
options.structures = []
28-
this.unpackr = new Unpackr(options)
28+
this.unpackr = options.unpackr || new Unpackr(options)
2929
}
3030
_transform(chunk, encoding, callback) {
3131
if (this.incompleteBuffer) {

0 commit comments

Comments
 (0)