Last active
January 28, 2022 22:52
-
-
Save danieljpgo/793be994d9d7c85beca67ac3cf4e7853 to your computer and use it in GitHub Desktop.
/lib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if the code is running in the `browser`. | |
*/ | |
export function isBrowser() { | |
return typeof window === 'object'; | |
} | |
/** | |
* Checks if the code is running in the `server`. | |
*/ | |
export function isServer() { | |
return typeof window === 'undefined'; | |
} | |
/** | |
* Checks if the browser is `Internet Explorer`. | |
*/ | |
export function isInternetExplorer() { | |
return /* @cc_on!@ */ false || !!document.documentMode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment