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.
1 parent 00244fd commit 1be6315Copy full SHA for 1be6315
packages/core/src/tools/globalObject.ts
@@ -50,5 +50,6 @@ export const globalObject = getGlobalObject<GlobalObject>()
50
51
export const isBrowserEnvironment = 'document' in globalObject
52
export const isWorkerEnvironment = 'WorkerGlobalScope' in globalObject
53
+// @see https://stackoverflow.com/questions/4224606/how-to-check-whether-a-script-is-running-under-node-js
54
// @ts-expect-error module is undefined outside of Node.
55
export const isNodeEnvironment = typeof module !== 'undefined' && module.exports
0 commit comments