From 798e2dcd40d2774655fdb31d00282b060e81d256 Mon Sep 17 00:00:00 2001 From: Sol Lee <82362278+saul-atomrigs@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:26:35 +0900 Subject: [PATCH] fix(@toss/utils): Add 'Deno' in globalThis for isServer() (#447) * feat(@toss/utils): Remove typeof global checking in isServer() * feat(@toss/utils): Add 'Deno' in globalThis for isServer() * Update packages/common/utils/src/device/isServer.ts --------- Co-authored-by: Sojin Park Co-authored-by: Sojin Park --- packages/common/utils/src/device/isServer.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/common/utils/src/device/isServer.ts b/packages/common/utils/src/device/isServer.ts index 24cdf3ecb..7d08d9705 100644 --- a/packages/common/utils/src/device/isServer.ts +++ b/packages/common/utils/src/device/isServer.ts @@ -1,6 +1,5 @@ /** @tossdocs-ignore */ -declare const global: unknown; export function isServer() { - return typeof window === 'undefined' && typeof global !== 'undefined'; + return typeof window === 'undefined' || 'Deno' in globalThis; }