Skip to content

Commit 2ac2834

Browse files
Uzlopakwolfy1339
andauthored
refactor: assign fetch once (#709)
chore: assign fetch once Co-authored-by: wolfy1339 <[email protected]>
1 parent 94141f4 commit 2ac2834

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/fetch-wrapper.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ export default function fetchWrapper(
2525
let status: number;
2626
let url: string;
2727

28-
let { fetch } = globalThis;
29-
if (requestOptions.request?.fetch) {
30-
fetch = requestOptions.request.fetch;
31-
}
28+
const fetch: typeof globalThis.fetch =
29+
requestOptions.request?.fetch || globalThis.fetch;
3230

3331
if (!fetch) {
3432
throw new Error(

0 commit comments

Comments
 (0)