tiny-crypto-suite
Version:
Tiny tools, big crypto — seamless encryption and certificate handling for modern web and Node apps.
17 lines (14 loc) • 511 B
JavaScript
;
/**
* Determines if the environment is a browser.
*
* This constant checks if the code is running in a browser environment by verifying if
* the `window` object and the `window.document` object are available. It will return `true`
* if the environment is a browser, and `false` otherwise (e.g., in a Node.js environment).
*
* @constant {boolean}
*/
function isBrowser() {
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
}
exports.isBrowser = isBrowser;