Skip to content

Commit 5bb5ea3

Browse files
committed
🐛 improve check on node
1 parent a7fdde9 commit 5bb5ea3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/core/src/tools/globalObject.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ export function getGlobalObject<T = typeof globalThis>(): T {
4949
export const globalObject = getGlobalObject<GlobalObject>()
5050

5151
export const isWorkerEnvironment = 'WorkerGlobalScope' in globalObject
52+
// @ts-expect-error module is undefined outside of Node.
53+
export const isNodeEnvironment = typeof module !== 'undefined' && module.exports

0 commit comments

Comments
 (0)