File tree 3 files changed +268
-102
lines changed
3 files changed +268
-102
lines changed Original file line number Diff line number Diff line change 54
54
"unicorn/no-await-expression-member" : 0 ,
55
55
"unicorn/no-useless-undefined" : 0 ,
56
56
"unicorn/no-array-push-push" : 0 ,
57
+ "unicorn/no-array-for-each" : 0 ,
58
+ "unicorn/prefer-includes" : " warn" ,
57
59
"unicorn/no-process-exit" : 0 ,
58
60
"unicorn/consistent-function-scoping" : 0 ,
59
61
"@typescript-eslint/no-explicit-any" : 0 ,
Original file line number Diff line number Diff line change @@ -178,16 +178,17 @@ export class Connection {
178
178
return request ;
179
179
}
180
180
181
+
181
182
request (
182
183
params : ConnectionRequestParams ,
183
- callback : ( err : Error | null , response : http . ServerResponse | null ) => void
184
- ) {
184
+ callback : ( err : Error | null , response : http . IncomingMessage | null ) => void
185
+ ) : http . ClientRequest {
185
186
this . _openRequests ++ ;
186
187
let cleanedListeners = false ;
187
188
const requestParams = this . buildRequestObject ( params ) ;
188
189
if ( INVALID_PATH_REGEX . test ( requestParams . path as string ) === true ) {
189
190
callback ( new TypeError ( `ERR_UNESCAPED_CHARACTERS: ${ requestParams . path } ` ) , null ) ;
190
- return { abort : NOOP } ;
191
+ return { abort : NOOP } as http . ClientRequest ;
191
192
}
192
193
193
194
debug ( "Starting a new request" , params ) ;
@@ -205,8 +206,6 @@ export class Connection {
205
206
this . _openRequests -- ;
206
207
request . once ( "error" , NOOP ) ;
207
208
request . abort ( ) ;
208
- // TODO: This should be a TimeoutError
209
- // callback(new TimeoutError("Request timed out", params), null);
210
209
callback ( new TimeoutError ( "Request timed out" ) , null ) ;
211
210
} ;
212
211
You can’t perform that action at this time.
0 commit comments