File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
packages/parser-slip-encoder/lib Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,12 @@ class SlipEncoder extends Transform {
3535 ...options ,
3636 }
3737 this . opts = opts
38-
39- if ( options . bluetoothQuirk ) {
40- this . _bluetoothQuirk = true
41- }
4238 }
4339
4440 _transform ( chunk , encoding , cb ) {
4541 const chunkLength = chunk . length
4642
47- if ( this . _bluetoothQuirk && chunkLength === 0 ) {
43+ if ( this . opts . bluetoothQuirk && chunkLength === 0 ) {
4844 // Edge case: push no data. Bluetooth-quirky SLIP parsers don't like
4945 // lots of 0xC0s together.
5046 return cb ( )
@@ -55,7 +51,7 @@ class SlipEncoder extends Transform {
5551 const encoded = Buffer . alloc ( chunkLength * 2 + 2 )
5652 let j = 0
5753
58- if ( this . _bluetoothQuirk == true ) {
54+ if ( this . opts . bluetoothQuirk == true ) {
5955 encoded [ j ++ ] = this . opts . END
6056 }
6157
Original file line number Diff line number Diff line change 1- module . exports = {
2- SlipEncoder : require ( './encoder' ) ,
3- SlipDecoder : require ( './decoder' ) ,
4- }
1+ const SlipEncoder = require ( './encoder' )
2+ const SlipDecoder = require ( './decoder' )
3+
4+ module . exports = SlipEncoder
5+ module . exports . SlipEncoder = SlipEncoder
6+ module . exports . SlipDecoder = SlipDecoder
You can’t perform that action at this time.
0 commit comments