refactor: lint cleanups and helpers

This commit is contained in:
Peter Steinberger
2025-12-23 00:28:40 +00:00
parent f5837dff9c
commit 918cbdcf03
39 changed files with 679 additions and 338 deletions

View File

@@ -3,6 +3,8 @@ import { ProxyAgent } from "undici";
export function makeProxyFetch(proxyUrl: string): typeof fetch {
const agent = new ProxyAgent(proxyUrl);
return (input: RequestInfo | URL, init?: RequestInit) =>
fetch(input, { ...(init ?? {}), dispatcher: agent });
return (input: RequestInfo | URL, init?: RequestInit) => {
const base = init ? { ...init } : {};
return fetch(input, { ...base, dispatcher: agent });
};
}