@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
15 lines (14 loc) • 415 B
JavaScript
import { isNodeEnv } from "./node.js";
import { GLOBAL_OBJ } from "./worldwide.js";
// src/utils/isBrowser.ts
/**
* Returns true if we are in the browser.
*/
function isBrowser() {
return typeof window !== "undefined" && (!isNodeEnv() || isElectronNodeRenderer());
}
function isElectronNodeRenderer() {
return GLOBAL_OBJ.process?.type === "renderer";
}
export { isBrowser };
//# sourceMappingURL=isBrowser.js.map