-
-
Save miaulightouch/ef1691a867c9d7e6d47b9178b69caaa1 to your computer and use it in GitHub Desktop.
This file contains 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
import browser from './browser' | |
import node from './node' | |
/** | |
* Detect environment | |
*/ | |
const debug = | |
// web browsers | |
typeof process === 'undefined' || | |
// Electron | |
process.type === 'renderer' || | |
// nwjs | |
process.__nwjs || | |
// 'process' package | |
process.browser | |
? browser() | |
: node() | |
export default debug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment