"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _isNotNumber = _interopRequireDefault(require("../../helpers/float/isNotNumber"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _checkInt = s => {
  var n = s == undefined ? '' : s.toString().replace(/,/g, '.');
  if ((0, _isNotNumber.default)(n)) {
    return false;
  }
  return true;
};
var useIntProps = () => {
  var toInt = s => {
    if (!_checkInt(s)) {
      //console.log(`toInt ${typeof s} [${s}] => 0 (not int)`)
      return 0;
    }
    return parseInt(s.toString().replace(/,/g, '.'));
  };
  var fromInt = f => {
    if ((0, _isNotNumber.default)(f)) {
      //console.log(`fromInt ${typeof f} [${f}] => "" (not number)`)
      return '';
    }
    var s = parseInt(f).toString();
    return s;
  };
  var t = {
    from: fromInt,
    to: toInt
  };
  return t;
};
var _default = useIntProps;
exports.default = _default;