From 7cf15c17f9c6fda714e492f38b1cf699f2f4506b Mon Sep 17 00:00:00 2001 From: Seth Holladay Date: Sat, 10 Aug 2024 17:15:55 -0400 Subject: [PATCH] Remove unnecessary setting of `credentials` option The `input.credentials` will be used automatically by `fetch()` if `options.credentials` is not defined, so copying it over manually is unnecessary. --- source/core/Ky.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source/core/Ky.ts b/source/core/Ky.ts index 92f05f37..218a9c22 100644 --- a/source/core/Ky.ts +++ b/source/core/Ky.ts @@ -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(