Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
586 B
Text
19 lines
586 B
Text
import { isNodeEnv } from './node.js';
|
|
import { GLOBAL_OBJ } from './worldwide.js';
|
|
|
|
/**
|
|
* Returns true if we are in the browser.
|
|
*/
|
|
function isBrowser() {
|
|
// eslint-disable-next-line no-restricted-globals
|
|
return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());
|
|
}
|
|
|
|
// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them
|
|
function isElectronNodeRenderer() {
|
|
const process = (GLOBAL_OBJ ).process;
|
|
return process?.type === 'renderer';
|
|
}
|
|
|
|
export { isBrowser };
|
|
//# sourceMappingURL=isBrowser.js.map
|