@@ -42,7 +42,7 @@ function destroy(err, cb) {
42
42
// With duplex streams we use the writable side for state.
43
43
const s = w || r ;
44
44
45
- if ( ( w && w . destroyed ) || ( r && r . destroyed ) ) {
45
+ if ( w ? .destroyed || r ? .destroyed ) {
46
46
if ( typeof cb === 'function' ) {
47
47
cb ( ) ;
48
48
}
@@ -128,7 +128,7 @@ function emitCloseNT(self) {
128
128
r . closeEmitted = true ;
129
129
}
130
130
131
- if ( ( w && w . emitClose ) || ( r && r . emitClose ) ) {
131
+ if ( w ? .emitClose || r ? .emitClose ) {
132
132
self . emit ( 'close' ) ;
133
133
}
134
134
}
@@ -137,7 +137,7 @@ function emitErrorNT(self, err) {
137
137
const r = self . _readableState ;
138
138
const w = self . _writableState ;
139
139
140
- if ( ( w && w . errorEmitted ) || ( r && r . errorEmitted ) ) {
140
+ if ( w ? .errorEmitted || r ? .errorEmitted ) {
141
141
return ;
142
142
}
143
143
@@ -192,11 +192,11 @@ function errorOrDestroy(stream, err, sync) {
192
192
const r = stream . _readableState ;
193
193
const w = stream . _writableState ;
194
194
195
- if ( ( w && w . destroyed ) || ( r && r . destroyed ) ) {
195
+ if ( w ? .destroyed || r ? .destroyed ) {
196
196
return this ;
197
197
}
198
198
199
- if ( ( r && r . autoDestroy ) || ( w && w . autoDestroy ) )
199
+ if ( r ? .autoDestroy || w ? .autoDestroy )
200
200
stream . destroy ( err ) ;
201
201
else if ( err ) {
202
202
// Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364
@@ -283,7 +283,7 @@ function emitConstructNT(stream) {
283
283
}
284
284
285
285
function isRequest ( stream ) {
286
- return stream && stream . setHeader && typeof stream . abort === 'function' ;
286
+ return stream ? .setHeader && typeof stream . abort === 'function' ;
287
287
}
288
288
289
289
function emitCloseLegacy ( stream ) {
0 commit comments