File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,23 @@ function Duplex(options) {
5656 Readable . call ( this , options ) ;
5757 Writable . call ( this , options ) ;
5858
59- this . allowHalfOpen = options ?. allowHalfOpen !== false ;
59+ if ( options ) {
60+ this . allowHalfOpen = options . allowHalfOpen !== false ;
6061
61- if ( options ? .readable === false ) {
62- this . _readableState . readable = false ;
63- this . _readableState . ended = true ;
64- this . _readableState . endEmitted = true ;
65- }
62+ if ( options . readable === false ) {
63+ this . _readableState . readable = false ;
64+ this . _readableState . ended = true ;
65+ this . _readableState . endEmitted = true ;
66+ }
6667
67- if ( options ?. writable === false ) {
68- this . _writableState . writable = false ;
69- this . _writableState . ending = true ;
70- this . _writableState . ended = true ;
71- this . _writableState . finished = true ;
68+ if ( options . writable === false ) {
69+ this . _writableState . writable = false ;
70+ this . _writableState . ending = true ;
71+ this . _writableState . ended = true ;
72+ this . _writableState . finished = true ;
73+ }
74+ } else {
75+ this . allowHalfOpen = true ;
7276 }
7377}
7478
You can’t perform that action at this time.
0 commit comments