Skip to content

Commit

Permalink
fix(@toss/utils): Add 'Deno' in globalThis for isServer() (#447)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Sojin Park <[email protected]>
  • Loading branch information
3 people authored Mar 22, 2024
1 parent 556dda6 commit 798e2dc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/common/utils/src/device/isServer.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 798e2dc

Please sign in to comment.