Skip to content

Commit 67afe41

Browse files
committed
chore: don't globalise fetch
1 parent b9a8941 commit 67afe41

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/muse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Headers } from "headers-polyfill";
66
globalThis.Headers = Headers;
77

88
// Headers
9-
import "./polyfills/fetch.js";
109

1110
// base64
1211
import "./polyfills/base64.js";
@@ -20,7 +19,9 @@ import "./polyfills/abortcontroller.js";
2019

2120
import { setup } from "libmuse";
2221
import { MuzikaSecretStore } from "./util/secret-store.js";
22+
import { fetch } from "./polyfills/fetch.js";
2323

2424
setup({
2525
store: new MuzikaSecretStore(),
26+
fetch: fetch as unknown as typeof globalThis.fetch,
2627
});

src/polyfills/fetch.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,3 @@ export async function fetch(url: string | URL, options: FetchOptions = {}) {
303303

304304
return response;
305305
}
306-
307-
// @ts-expect-error setting a global
308-
window.fetch = fetch;

0 commit comments

Comments
 (0)