UNPKG

a2r

Version:
25 lines (21 loc) 620 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const getIsClientContent = () => `let forceServerSimulation = false; /** * Allows you to disable client detection * @param {boolean} value True to force Server Side Simulation */ export const setForceServerSimulation = (value: boolean): void => { forceServerSimulation = value; }; /** * Checks if the script is running on the client side */ const isClient = (): boolean => { if (forceServerSimulation) { return false; } return typeof window === 'object'; }; export default isClient;`; exports.default = getIsClientContent;