Skip to content

Commit

Permalink
Remove unnecessary setting of credentials option (#616)
Browse files Browse the repository at this point in the history
The `input.credentials` will be used automatically by `fetch()` if `options.credentials` is not defined, so copying it over manually is unnecessary.
  • Loading branch information
sholladay authored Aug 10, 2024
1 parent 9728f4b commit fbe0ec6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions source/core/Ky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,8 @@ export class Ky {
// eslint-disable-next-line complexity
constructor(input: Input, options: Options = {}) {
this._input = input;
const credentials
= this._input instanceof Request && 'credentials' in Request.prototype
? this._input.credentials
: undefined;

this._options = {
...(credentials && {credentials}), // For exactOptionalPropertyTypes
...options,
headers: mergeHeaders((this._input as Request).headers, options.headers),
hooks: mergeHooks(
Expand Down

0 comments on commit fbe0ec6

Please sign in to comment.