Skip to content

Commit 10e8871

Browse files
committed
fix: don't return true for isNode() under Deno
as of Deno 2.4, the 'process' and 'global' variables are set in the global environment, so it's better to explciitly exclude it now
1 parent baa38fa commit 10e8871

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/type_guards.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export function isNetAddr(value: unknown): value is NetAddr {
4141

4242
export function isNode(): boolean {
4343
return "process" in globalThis && "global" in globalThis &&
44-
!("Bun" in globalThis) && !("WebSocketPair" in globalThis);
44+
!("Bun" in globalThis) && !("WebSocketPair" in globalThis) &&
45+
!("Deno" in globalThis);
4546
}
4647

4748
export function isFsFile(value: unknown): value is Deno.FsFile {

0 commit comments

Comments
 (0)