In short, I am faced with the task of converting the headers of a RequestInit
into a format that another library can comprehend. This particular library requires the headers to be in the format of Object<string, string>
. Initially, I attempted something like this:
headers: {
...init?.headers,
},
However, it turned out to be more complicated than expected. It appears that some values in init.headers
are of type number, leading to issues with TypeScript. How can I effectively convert these values to prevent any complaints from TypeScript?