From e6b7c6d1952b45585dcd31268723db5cfca9c09b Mon Sep 17 00:00:00 2001 From: Alexandre ABRIOUX Date: Fri, 7 Nov 2025 17:15:52 +0100 Subject: [PATCH] fix(utils): fetch bindings --- src/utils/connect/fetch.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/connect/fetch.ts b/src/utils/connect/fetch.ts index a301db549..9ff888241 100644 --- a/src/utils/connect/fetch.ts +++ b/src/utils/connect/fetch.ts @@ -1,8 +1,8 @@ import { LibraryError } from '../errors'; -export default (typeof globalThis !== 'undefined' && globalThis.fetch.bind(globalThis)) || - (typeof window !== 'undefined' && window.fetch.bind(window)) || - (typeof global !== 'undefined' && global.fetch.bind(global)) || +export default (typeof globalThis?.fetch !== 'undefined' && globalThis.fetch.bind(globalThis)) || + (typeof window?.fetch !== 'undefined' && window.fetch.bind(window)) || + (typeof global?.fetch !== 'undefined' && global.fetch.bind(global)) || ((() => { throw new LibraryError( "'fetch()' not detected, use the 'baseFetch' constructor parameter to set it"