Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 904 Bytes

20211013_axios_0_23.md

File metadata and controls

23 lines (13 loc) · 904 Bytes

Update of axios > 0.21

This migration is only required if you are using TypeScript.

Update to the latest version of axios

In your adapter directory run the following command to ensure you have the latest version of axios:

npm i axios@latest

Update calls to axios

Wherever you called axios(...) in your code, you need to replace this with axios.request<any>(...).

The only place where such code is generated by create-adapter is in lib/tools.ts in the two functions translateYandex() and translateGoogle().

You might have other places where you used axios, make sure you update all of them.

Better than any

For your own code you might want to consider using a real type (e.g. an interface) as the response type of the axios request (instead of any). This will make your code more understandable and help you spot issues which would be hidden by using any.