Skip to content

Commit

Permalink
Fix NormalizedOptions
Browse files Browse the repository at this point in the history
Otherwise it fails with `skipLibCheck: false` and `exactOptionalPropertyTypes:
true`, as optional types get resolved as `Foo | undefined`, not just `Foo`.
  • Loading branch information
alecmev committed Nov 12, 2023
1 parent d7b0abc commit 621b171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ Normalized options passed to the `fetch` call and the `beforeRequest` hooks.
*/
export interface NormalizedOptions extends RequestInit { // eslint-disable-line @typescript-eslint/consistent-type-definitions -- This must stay an interface so that it can be extended outside of Ky for use in `ky.create`.
// Extended from `RequestInit`, but ensured to be set (not optional).
method: RequestInit['method'];
credentials: RequestInit['credentials'];
method: NonNullable<RequestInit['method']>;
credentials: NonNullable<RequestInit['credentials']>;

// Extended from custom `KyOptions`, but ensured to be set (not optional).
retry: RetryOptions;
Expand Down

0 comments on commit 621b171

Please sign in to comment.