diff --git a/package.json b/package.json index 8d7581c8..6c488060 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "mime-types": "^2.1.35", "pump": "^3.0.0", "qs": "^6.11.2", - "type-fest": "^4.3.1", "undici": "^5.22.1", "ylru": "^1.3.2" }, diff --git a/src/HttpClient.ts b/src/HttpClient.ts index de69ebf3..de021c57 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -39,8 +39,6 @@ import { initDiagnosticsChannel } from './diagnosticsChannel.js'; type Exists = T extends undefined ? never : T; type UndiciRequestOption = Exists[1]>; -type PropertyShouldBe = Omit & { [P in K]: V }; -type IUndiciRequestOption = PropertyShouldBe; const PROTO_RE = /^https?:\/\//i; const FormData = FormDataNative ?? FormDataNode; @@ -347,7 +345,7 @@ export class HttpClient extends EventEmitter { } try { - const requestOptions: IUndiciRequestOption = { + const requestOptions: UndiciRequestOption = { method, maxRedirections: args.maxRedirects ?? 10, headersTimeout, diff --git a/src/IncomingHttpHeaders.ts b/src/IncomingHttpHeaders.ts index adc42aac..9407f682 100644 --- a/src/IncomingHttpHeaders.ts +++ b/src/IncomingHttpHeaders.ts @@ -1,7 +1,3 @@ -import type { Except } from 'type-fest'; -import type { IncomingHttpHeaders as HTTPIncomingHttpHeaders } from 'node:http'; - // fix set-cookie type define https://github.com/nodejs/undici/pull/1893 -export interface IncomingHttpHeaders extends Except { - 'set-cookie'?: string | string[]; -} +// keep the same type as undici IncomingHttpHeaders +export type IncomingHttpHeaders = Record;