"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _getSize = (size, value, options) => {
  if (typeof size == 'function') {
    try {
      return size(value, options);
    } catch (e) {
      console.error(e);
    }
  }
  if (!isNaN(size)) {
    return parseInt(size);
  }
  if (Array.isArray(options)) {
    return options.length;
  }
  try {
    return Object.keys(options).length;
  } catch (e) {
    console.error(e);
  }
  return 2;
};
var useSize = (size, value, options) => {
  var [theSize, setTheSize] = (0, _react.useState)(_getSize(size, value, options));
  (0, _react.useEffect)(() => {
    setTheSize(_getSize(size, value, options));
  }, [size, value, options]);
  return theSize;
};
var _default = useSize;
exports.default = _default;