@@ -206,19 +206,14 @@ module ClientRequest {
206
206
/**
207
207
* A model of a URL request made using the `axios` library.
208
208
*/
209
- class AxiosUrlRequest extends ClientRequest:: Range {
209
+ class AxiosUrlRequest extends ClientRequest:: Range , API :: CallNode {
210
210
string method ;
211
211
212
212
AxiosUrlRequest ( ) {
213
- exists ( string moduleName , DataFlow:: SourceNode callee | this = callee .getACall ( ) |
214
- moduleName = "axios" and
215
- (
216
- callee = DataFlow:: moduleImport ( moduleName ) and method = "request"
217
- or
218
- callee = DataFlow:: moduleMember ( moduleName , method ) and
219
- ( method = httpMethodName ( ) or method = "request" )
220
- )
221
- )
213
+ this = API:: moduleImport ( "axios" ) .getACall ( ) and method = "request"
214
+ or
215
+ this = API:: moduleImport ( "axios" ) .getMember ( method ) .getACall ( ) and
216
+ method = [ httpMethodName ( ) , "request" ]
222
217
}
223
218
224
219
private int getOptionsArgIndex ( ) {
@@ -247,12 +242,10 @@ module ClientRequest {
247
242
method = "request" and
248
243
result = getOptionArgument ( 0 , "data" )
249
244
or
250
- ( method = "post" or method = "put" or method = "put" ) and
251
- ( result = getArgument ( 1 ) or result = getOptionArgument ( 2 , "data" ) )
245
+ method = [ "post" , "put" , "put" ] and
246
+ result = [ getArgument ( 1 ) , getOptionArgument ( 2 , "data" ) ]
252
247
or
253
- exists ( string name | name = "headers" or name = "params" |
254
- result = getOptionArgument ( [ 0 .. 2 ] , name )
255
- )
248
+ result = getOptionArgument ( [ 0 .. 2 ] , [ "headers" , "params" ] )
256
249
}
257
250
258
251
/** Gets the response type from the options passed in. */
0 commit comments