"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.parseValueDependOnOptions = void 0;
var parseValueDependOnOptions = (v, options) => {
  var iValue = v;

  // check if is Numeric and convert
  if (!isNaN(iValue)) {
    var optVals = options.map(o => o.value);
    if (optVals.indexOf(iValue) < 0) {
      if (optVals.indexOf(parseFloat(iValue)) >= 0) {
        iValue = parseFloat(iValue);
      } else if (optVals.indexOf(parseInt(iValue)) >= 0) {
        iValue = parseInt(iValue);
      }
    }
  }
  return iValue;
};
exports.parseValueDependOnOptions = parseValueDependOnOptions;