🔧 fix: type checking for process.browser in api-endpoints.ts

This commit is contained in:
Danny Avila 2025-08-27 20:27:57 -04:00
parent 229d6f2dfe
commit 2483623c88
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -3,7 +3,10 @@ import * as q from './types/queries';
import { ResourceType } from './accessPermissions';
let BASE_URL = '';
if (typeof process === 'undefined' || process?.browser === true) {
if (
typeof process === 'undefined' ||
(process as typeof process & { browser?: boolean }).browser === true
) {
// process is only available in node context, or process.browser is true in client-side code
// This is to ensure that the BASE_URL is set correctly based on the <base>
// element in the HTML document, if it exists.