From 19ecdce2751d51b177c47341fc3bbe09759e6ec9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 4 Feb 2026 04:09:53 -0800 Subject: [PATCH] fix: align proxy fetch typing --- src/telegram/proxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/telegram/proxy.ts b/src/telegram/proxy.ts index f88b9d392..1f9c6f2bc 100644 --- a/src/telegram/proxy.ts +++ b/src/telegram/proxy.ts @@ -5,10 +5,10 @@ export function makeProxyFetch(proxyUrl: string): typeof fetch { const agent = new ProxyAgent(proxyUrl); // undici's fetch is runtime-compatible with global fetch but the types diverge // on stream/body internals. Single cast at the boundary keeps the rest type-safe. - const fetcher = (input: RequestInfo | URL, init?: RequestInit) => + const fetcher = ((input: RequestInfo | URL, init?: RequestInit) => undiciFetch(input as string | URL, { ...(init as Record), dispatcher: agent, - }) as unknown as Promise; + }) as unknown as Promise) as typeof fetch; return wrapFetchWithAbortSignal(fetcher); }