We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
process
1 parent 6d9a766 commit 3545fd5Copy full SHA for 3545fd5
packages/utils/src/isBrowser.ts
@@ -1,4 +1,5 @@
1
import { isNodeEnv } from './node';
2
+import { GLOBAL_OBJ } from './worldwide';
3
4
/**
5
* Returns true if we are in the browser.
@@ -12,5 +13,8 @@ type ElectronProcess = { type?: string };
12
13
14
// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them
15
function isElectronNodeRenderer(): boolean {
- return typeof process !== 'undefined' && (process as ElectronProcess).type === 'renderer';
16
+ return (
17
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
18
+ (GLOBAL_OBJ as any).process !== undefined && ((GLOBAL_OBJ as any).process as ElectronProcess).type === 'renderer'
19
+ );
20
}
0 commit comments