import { getWindow } from "./getWindow" ; function checkIsBrowser ( ) { const _window = getWindow ( ) ; return Boolean ( typeof _window !== "undefined" && _window . document && _window . document . createElement ) ; } example export const canUseDOM = checkIsBrowser ( ) ;