@@ -76,9 +76,9 @@ const generateAxiosImplementation = (
7676 } : GeneratorVerbOptions ,
7777 { route, context } : GeneratorOptions ,
7878) => {
79- const isRequestOptions = override ? .requestOptions !== false ;
80- const isFormData = ! override ? .formData . disabled ;
81- const isFormUrlEncoded = override ? .formUrlEncoded !== false ;
79+ const isRequestOptions = override . requestOptions !== false ;
80+ const isFormData = ! override . formData . disabled ;
81+ const isFormUrlEncoded = override . formUrlEncoded !== false ;
8282 const isExactOptionalPropertyTypes =
8383 ! ! context . output . tsconfig ?. compilerOptions ?. exactOptionalPropertyTypes ;
8484
@@ -110,7 +110,7 @@ const generateAxiosImplementation = (
110110
111111 const requestOptions = isRequestOptions
112112 ? generateMutatorRequestOptions (
113- override ? .requestOptions ,
113+ override . requestOptions ,
114114 mutator . hasSecondArg ,
115115 )
116116 : '' ;
@@ -154,11 +154,11 @@ const generateAxiosImplementation = (
154154 queryParams,
155155 response,
156156 verb,
157- requestOptions : override ? .requestOptions ,
157+ requestOptions : override . requestOptions ,
158158 isFormData,
159159 isFormUrlEncoded,
160160 paramsSerializer,
161- paramsSerializerOptions : override ? .paramsSerializerOptions ,
161+ paramsSerializerOptions : override . paramsSerializerOptions ,
162162 isExactOptionalPropertyTypes,
163163 hasSignal : false ,
164164 } ) ;
@@ -222,6 +222,9 @@ export const generateAxiosFooter: ClientFooterBuilder = ({
222222
223223 for ( const operationName of operationNames ) {
224224 if ( returnTypesToWrite . has ( operationName ) ) {
225+ // Map.has ensures Map.get will not return undefined, but TS still complains
226+ // bug https://github.com/microsoft/TypeScript/issues/13086
227+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
225228 const func = returnTypesToWrite . get ( operationName ) ! ;
226229 footer += func ( noFunction ? undefined : title ) + '\n' ;
227230 }
@@ -240,10 +243,7 @@ export const generateAxios = (
240243 return { implementation, imports } ;
241244} ;
242245
243- export const generateAxiosFunctions : ClientBuilder = async (
244- verbOptions ,
245- options ,
246- ) => {
246+ export const generateAxiosFunctions : ClientBuilder = ( verbOptions , options ) => {
247247 const { implementation, imports } = generateAxios ( verbOptions , options ) ;
248248
249249 return {
0 commit comments