Skip to content

Commit

Permalink
refactor: assign fetch once (#709)
Browse files Browse the repository at this point in the history
chore: assign fetch once

Co-authored-by: wolfy1339 <[email protected]>
  • Loading branch information
Uzlopak and wolfy1339 authored Jul 11, 2024
1 parent 94141f4 commit 2ac2834
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2ac2834

Please sign in to comment.