@@ -90,15 +90,15 @@ export default function timedOut(request: ClientRequest, delays: Delays, options
9090 }
9191 } ) ;
9292
93- if ( typeof delays . request !== ' undefined' ) {
93+ if ( delays . request !== undefined ) {
9494 const cancelTimeout = addTimeout ( delays . request , timeoutHandler , 'request' ) ;
9595
9696 once ( request , 'response' , ( response : IncomingMessage ) : void => {
9797 once ( response , 'end' , cancelTimeout ) ;
9898 } ) ;
9999 }
100100
101- if ( typeof delays . socket !== ' undefined' ) {
101+ if ( delays . socket !== undefined ) {
102102 const { socket} = delays ;
103103
104104 const socketTimeoutHandler = ( ) : void => {
@@ -115,10 +115,10 @@ export default function timedOut(request: ClientRequest, delays: Delays, options
115115 } ) ;
116116 }
117117
118- const hasLookup = typeof delays . lookup !== ' undefined' ;
119- const hasConnect = typeof delays . connect !== ' undefined' ;
120- const hasSecureConnect = typeof delays . secureConnect !== ' undefined' ;
121- const hasSend = typeof delays . send !== ' undefined' ;
118+ const hasLookup = delays . lookup !== undefined ;
119+ const hasConnect = delays . connect !== undefined ;
120+ const hasSecureConnect = delays . secureConnect !== undefined ;
121+ const hasSend = delays . send !== undefined ;
122122 if ( hasLookup || hasConnect || hasSecureConnect || hasSend ) {
123123 once ( request , 'socket' , ( socket : net . Socket ) : void => {
124124 const { socketPath} = request as ClientRequest & { socketPath ?: string } ;
@@ -127,7 +127,7 @@ export default function timedOut(request: ClientRequest, delays: Delays, options
127127 if ( socket . connecting ) {
128128 const hasPath = Boolean ( socketPath ?? net . isIP ( hostname ?? host ?? '' ) !== 0 ) ;
129129
130- if ( hasLookup && ! hasPath && typeof ( socket . address ( ) as net . AddressInfo ) . address === ' undefined' ) {
130+ if ( hasLookup && ! hasPath && ( socket . address ( ) as net . AddressInfo ) . address === undefined ) {
131131 const cancelTimeout = addTimeout ( delays . lookup ! , timeoutHandler , 'lookup' ) ;
132132 once ( socket , 'lookup' , cancelTimeout ) ;
133133 }
@@ -168,14 +168,14 @@ export default function timedOut(request: ClientRequest, delays: Delays, options
168168 } ) ;
169169 }
170170
171- if ( typeof delays . response !== ' undefined' ) {
171+ if ( delays . response !== undefined ) {
172172 once ( request , 'upload-complete' , ( ) : void => {
173173 const cancelTimeout = addTimeout ( delays . response ! , timeoutHandler , 'response' ) ;
174174 once ( request , 'response' , cancelTimeout ) ;
175175 } ) ;
176176 }
177177
178- if ( typeof delays . read !== ' undefined' ) {
178+ if ( delays . read !== undefined ) {
179179 once ( request , 'response' , ( response : IncomingMessage ) : void => {
180180 const cancelTimeout = addTimeout ( delays . read ! , timeoutHandler , 'read' ) ;
181181 once ( response , 'end' , cancelTimeout ) ;
0 commit comments