/**
 * 获取可视区宽高
 * @returns {{clientWidth: number, clientHeight: number}}
 *
 * @example
 * const { clientWidth, clientHeight } = getClientSize();
 */
function getClientSize() {
  var a = 'inner';
  var e = window;

  if (!('innerWidth' in window)) {
    a = 'client';
    e = document.documentElement || document.body;
  }

  return {
    clientWidth: e["".concat(a, "Width")],
    clientHeight: e["".concat(a, "Height")]
  };
}

export default getClientSize;
