Make AxiosError.config optional in the type definition (#4665)

It is optional in the constructor, and not always defined.

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Bertrand Marron 2022-05-03 18:37:51 +02:00 committed by GitHub
parent 12faca87e0
commit 205bd0f01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
index.d.ts vendored
View File

@ -148,7 +148,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
response?: AxiosResponse<T, D>
);
config: AxiosRequestConfig<D>;
config?: AxiosRequestConfig<D>;
code?: string;
request?: any;
response?: AxiosResponse<T, D>;