export const fetchOptions =
(newOpts: RequestInit) =>
(url: string, opts: RequestInit = {}) =>
fetch(url, mergeDeepLeft(opts, newOpts));
error TS2769: No overload matches this call.
Overload 1 of 2, '(input: RequestInfo | URL, init?: RequestInit): Promise<Response>', gave the following error.
Argument of type 'MergeDeepObject<RequestInit, RequestInit, BuiltIn, undefined, _OptionalKeys<RequestInit>>' is not assignable to parameter of type 'RequestInit'.
Types of property 'body' are incompatible.
Type 'unknown' is not assignable to type 'BodyInit'.
Overload 2 of 2, '(input: RequestInfo | URL, init?: RequestInit): Promise<Response>', gave the following error.
Argument of type 'MergeDeepObject<RequestInit, RequestInit, BuiltIn, undefined, _OptionalKeys<RequestInit>>' is not assignable to parameter of type 'RequestInit'.
Types of property 'body' are incompatible.
Type 'unknown' is not assignable to type 'BodyInit'.
38 fetch(url, mergeDeepLeft(opts, newOpts));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have a helperfunction which stopped to type check when updating from 0.31.1 to 0.32.0. Simplified to:
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbziAplA5igIilYAyKAZvAL5xFQQhwDkUAhiACYO0DcAUJygB6Sw4AYwgA7AM7wiKGEIAWAeTAxgY8XAC8nODrgAKUSgDuSmOIBccAEooAjgFcUkgJKjgMAJSaAfNt177KAAbS0koYFF0ABo4CGULaztHFzd4DURSLw1fXVyKGXkA4JjUDGxcAmIYPTizGMMTeI8PLiA
It now fails with the following error: