From 9c5ed2b4fad342985d7f6c283a23e916f8adf0d8 Mon Sep 17 00:00:00 2001 From: Bjorn Stromberg Date: Wed, 10 Jul 2024 10:00:53 +0800 Subject: [PATCH] fix: remove unnecessary type assertions --- source/core/options.ts | 2 +- source/core/utils/options-to-url.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/options.ts b/source/core/options.ts index f3aedef90..ad81a55e3 100644 --- a/source/core/options.ts +++ b/source/core/options.ts @@ -950,7 +950,7 @@ const cloneRaw = (raw: OptionsInit) => { }; const getHttp2TimeoutOption = (internals: typeof defaultInternals): number | undefined => { - const delays = [internals.timeout.socket, internals.timeout.connect, internals.timeout.lookup, internals.timeout.request, internals.timeout.secureConnect].filter(delay => typeof delay === 'number') as number[]; + const delays = [internals.timeout.socket, internals.timeout.connect, internals.timeout.lookup, internals.timeout.request, internals.timeout.secureConnect].filter(delay => typeof delay === 'number'); if (delays.length > 0) { return Math.min(...delays); diff --git a/source/core/utils/options-to-url.ts b/source/core/utils/options-to-url.ts index 44e66dd6c..e27450489 100644 --- a/source/core/utils/options-to-url.ts +++ b/source/core/utils/options-to-url.ts @@ -63,7 +63,7 @@ export default function optionsToUrl(origin: string, options: URLOptions): URL { for (const key of keys) { if (options[key]) { - url[key] = options[key]!.toString(); + url[key] = options[key].toString(); } }