Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
some eslint and compatibility things
Browse files Browse the repository at this point in the history
  • Loading branch information
Bam4d committed Jan 15, 2024
1 parent 50ae496 commit 984a83a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
let isNode = false;
if (typeof window === 'undefined' || typeof globalThis.fetch !== 'undefined') {
globalThis.fetch = (await import('node-fetch')).default;
isNode = true;
}

/**
* Initialize fetch
* @return {Promise<void>}
*/
async function initializeFetch() {
if (typeof globalThis.fetch === 'undefined') {
if (typeof window === 'undefined' ||
typeof globalThis.fetch === 'undefined') {
const nodeFetch = await import('node-fetch');
fetch = nodeFetch.default;
isNode = true;
Expand Down

0 comments on commit 984a83a

Please sign in to comment.