File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,16 @@ export class TwitterOpenApi {
111111 accessToken : TwitterOpenApi . bearer ,
112112 } ;
113113 const flag =
114- options . flag ||
114+ options ? .flag ||
115115 ( ( await this . fetchApi ( TwitterOpenApi . url , { method : 'GET' } ) . then ( ( res ) => res . json ( ) ) ) as DefaultFlag ) ;
116116 return new TwitterOpenApiClient ( new i . Configuration ( config ) , flag ) ;
117117 }
118118
119- async getClientFromCookies ( ct0 : string , authToken : string ) : Promise < TwitterOpenApiClient > {
119+ async getClientFromCookies (
120+ ct0 : string ,
121+ authToken : string ,
122+ options ?: TwitterOpenApiClientOptions ,
123+ ) : Promise < TwitterOpenApiClient > {
120124 const cookies : TwitterOpenApiCookie [ ] = await this . getGuestSession ( ) ;
121125 [
122126 { name : 'auth_token' , value : authToken } ,
@@ -139,8 +143,10 @@ export class TwitterOpenApi {
139143 } ,
140144 accessToken : TwitterOpenApi . bearer ,
141145 } ;
142- const flag = this . fetchApi ( TwitterOpenApi . url , { method : 'GET' } ) . then ( ( res ) => res . json ( ) ) as Promise < DefaultFlag > ;
143- return new TwitterOpenApiClient ( new i . Configuration ( config ) , await flag ) ;
146+ const flag =
147+ options ?. flag ||
148+ ( ( await this . fetchApi ( TwitterOpenApi . url , { method : 'GET' } ) . then ( ( res ) => res . json ( ) ) ) as DefaultFlag ) ;
149+ return new TwitterOpenApiClient ( new i . Configuration ( config ) , flag ) ;
144150 }
145151}
146152
You can’t perform that action at this time.
0 commit comments