get-client-window-width
Version:
A safe way of returning the interior width of the window in pixels
20 lines (14 loc) • 532 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var isSupported = function isSupported() {
return typeof window !== 'undefined';
};
var getClientWindowWidth = function getClientWindowWidth() {
if (!isSupported()) {
return 0;
}
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
};
exports.default = getClientWindowWidth;
exports.getClientWindowWidth = getClientWindowWidth;
//# sourceMappingURL=get-client-window-width.cjs.development.js.map