src/utils.js
function tryConvertType(typeToConvert, value) {
  if (typeToConvert === 'string') {
    return value && value.toString();
  } else if (typeToConvert === 'number') {
    return Number(value);
  } else {
    return value;
  }
}
function tryConvertType(typeToConvert, value) {
  if (typeToConvert === 'string') {
    return value && value.toString();
  } else if (typeToConvert === 'number') {
    return Number(value);
  } else {
    return value;
  }
}
function tryConvertType ( typeToConvert , value ) { if ( typeToConvert === 'string' ) { return value && value . toString ( ) ; } else if ( typeToConvert === 'number' ) { return Number ( value ) ; } else { return value ; } }
Try to convert a value to a type.
If it can't be done, the value will be returned.

@param {string} typeToConvert The target type. e.g. "string", "number", etc.
@param {*} value The value to be converted into typeToConvert.
Try to convert a value to a type . If it can t be done the value will be returned .