(input: RequestInfo | URL, init?: RequestInit)
| 435 | const dispatcher = new Agent({ connect: { lookup: createPinnedLookup(resolvedIP) } }) |
| 436 | |
| 437 | const pinned = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => { |
| 438 | // double-cast-allowed: DOM RequestInfo/URL and undici fetch input types differ but are structurally compatible at runtime (Node's global fetch IS undici) |
| 439 | const undiciInput = input as unknown as Parameters<typeof undiciFetch>[0] |
| 440 | // double-cast-allowed: DOM RequestInit and undici RequestInit are structurally compatible at runtime but the TS types differ |
| 441 | const undiciInit: UndiciRequestInit = { ...(init as unknown as UndiciRequestInit), dispatcher } |
| 442 | const response = await undiciFetch(undiciInput, undiciInit) |
| 443 | // double-cast-allowed: undici Response and DOM Response are structurally compatible at runtime |
| 444 | return response as unknown as Response |
| 445 | } |
| 446 | |
| 447 | return pinned |
| 448 | } |
no outgoing calls
no test coverage detected