A try-catch block may be needed when the type is json.
Now, it seems that the code has been written to ensure that the API response value is JSON.
If an error occurs while call json method, it would be good to return empty object.
Temporary solution
instance.get(URL, { parseJson: (text) => text }).text();
Same as when use
JSON.parse('OK')
https://github.com/sindresorhus/ky/blob/main/source/core/Ky.ts#L81
A try-catch block may be needed when the type is
json
. Now, it seems that the code has been written to ensure that the API response value is JSON. If an error occurs while calljson
method, it would be good to return empty object.