diff --git a/src/fetch-wrapper.ts b/src/fetch-wrapper.ts index 10682c2c0..f2048060e 100644 --- a/src/fetch-wrapper.ts +++ b/src/fetch-wrapper.ts @@ -25,10 +25,8 @@ export default function fetchWrapper( let status: number; let url: string; - let { fetch } = globalThis; - if (requestOptions.request?.fetch) { - fetch = requestOptions.request.fetch; - } + const fetch: typeof globalThis.fetch = + requestOptions.request?.fetch || globalThis.fetch; if (!fetch) { throw new Error(