Skip to content

Commit

Permalink
Fix TS definition for AxiosRequestTransformer (#4201)
Browse files Browse the repository at this point in the history
The callback `AxiosRequestTransformer` can always expect its `headers`
parameter to be defined. This is ensured immediately before the callback
is made.
See: https://github.com/axios/axios/blob/1025d1231a7747503188459dd5a6d1effdcea928/lib/core/dispatchRequest.js#L32-L40

Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
brianhelba and jasonsaayman committed May 4, 2022
1 parent 1430393 commit eaaab30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Expand Up @@ -6,7 +6,7 @@ export type AxiosResponseHeaders = Record<string, string> & {
};

export interface AxiosRequestTransformer {
(data: any, headers?: AxiosRequestHeaders): any;
(data: any, headers: AxiosRequestHeaders): any;
}

export interface AxiosResponseTransformer {
Expand Down

0 comments on commit eaaab30

Please sign in to comment.