File tree 1 file changed +15
-11
lines changed
1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,23 @@ function Duplex(options) {
56
56
Readable . call ( this , options ) ;
57
57
Writable . call ( this , options ) ;
58
58
59
- this . allowHalfOpen = options ?. allowHalfOpen !== false ;
59
+ if ( options ) {
60
+ this . allowHalfOpen = options . allowHalfOpen !== false ;
60
61
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
+ }
66
67
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 ;
72
76
}
73
77
}
74
78
You can’t perform that action at this time.
0 commit comments