Skip to content

Commit

Permalink
chore: don't globalise fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Nov 12, 2024
1 parent b9a8941 commit 67afe41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/muse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Headers } from "headers-polyfill";
globalThis.Headers = Headers;

// Headers
import "./polyfills/fetch.js";

// base64
import "./polyfills/base64.js";
Expand All @@ -20,7 +19,9 @@ import "./polyfills/abortcontroller.js";

import { setup } from "libmuse";
import { MuzikaSecretStore } from "./util/secret-store.js";
import { fetch } from "./polyfills/fetch.js";

setup({
store: new MuzikaSecretStore(),
fetch: fetch as unknown as typeof globalThis.fetch,
});
3 changes: 0 additions & 3 deletions src/polyfills/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,3 @@ export async function fetch(url: string | URL, options: FetchOptions = {}) {

return response;
}

// @ts-expect-error setting a global
window.fetch = fetch;

0 comments on commit 67afe41

Please sign in to comment.