Skip to content

Commit

Permalink
fix(utils): update isClient to check document too (#3329)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
brc-dd and antfu committed Aug 25, 2023
1 parent b85154f commit 786cbba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/utils/is.ts
@@ -1,5 +1,5 @@
/* eslint-disable antfu/top-level-function */
export const isClient = typeof window !== 'undefined'
export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined'
export const isDef = <T = any>(val?: T): val is T => typeof val !== 'undefined'
export const notNullish = <T = any>(val?: T | null | undefined): val is T => val != null
export const assert = (condition: boolean, ...infos: any[]) => {
Expand Down

0 comments on commit 786cbba

Please sign in to comment.