Attempts to parse a string as some other type.
Right now, this parses numbers and booleans (case insensitive).
@param {String} value The text to parse
@type {String|Boolean|Number}

@private
510524
function(value, hint) {
	if (hint) {
		var hintParser = this[hint[0].toUpperCase() + hint.slice(1)];
		if (hintParser) {
			return hintParser(value);
		}
	}

	var numberValue = Number(value);
	if (!isNaN(numberValue)) {
		return numberValue;
	}

	var lowerValue = value.toLowerCase();
	if (lowerValue === "true") {
		return true;
	}
	else if (lowerValue === "false") {
		return false;
	}

	return value;
}
335915
function (value) {
        let val = parseInt(value, 10);
        if (isNaN(val)) {
            return false;
        }
        return (val + '').length === value.length;
    }
389491
function(value){
      return _.isNumber(value) || (_.isString(value) && value.match(defaultPatterns.number));
    }
858835
function parse(value, field, options) {
  options = options || {};
  var parsed = utils.standardizeInput(value);

  // Integer
  if (field.type.key === "BOOLEAN") {
    parsed = utils.toBoolean(parsed);
  }
  else if (field.type.key === "INTEGER") {
    parsed = utils.toInteger(parsed);
  }
  else if (field.type.key === "FLOAT") {
    parsed = utils.toFloat(parsed);
  }
  else if (field.type.key === "DATEONLY") {
    parsed = utils.toDate(parsed, options.dateFormat);
  }
  else if (field.type.key === "DATE") {
    parsed = utils.toDateTime(parsed, options.datetimeFormat);
  }
  else if (field.type.key === "STRING") {
    parsed = utils.toString(parsed);
  }

  return parsed;
}
1142666
function boolean(value) {
  var parsedBoolean = json(value);

  // handle 0|1 case
  if (typeOf(parsedBoolean) == 'number' && [0, 1].indexOf(parsedBoolean) > -1) {
    parsedBoolean = parsedBoolean === 0 ? false : true;
  }

  // couldn't parse it
  if (typeOf(parsedBoolean) != 'boolean') {
    return throwModifierError('boolean', value, {message: 'Invalid Boolean'});
  }

  return parsedBoolean;
}
1269961
function parseValueOfType(value, type, options) {
  switch (type) {
    case String:
      return { value }

    case Number:
    case 'Integer':
    case Integer:
      // The global isFinite() function determines
      // whether the passed value is a finite number.
      // If  needed, the parameter is first converted to a number.
      if (!isFinite(value)) {
        return { error: 'invalid' }
      }
      if (type === Integer && !isInteger(value)) {
        return { error: 'invalid' }
      }
      // Convert strings to numbers.
      // Just an additional feature.
      // Won't happen when called from `readXlsx()`.
      if (typeof value === 'string') {
        value = parseFloat(value)
      }
      return { value }

    case 'URL':
    case URL:
      if (!isURL(value)) {
        return { error: 'invalid' }
      }
      return { value }

    case 'Email':
    case Email:
      if (!isEmail(value)) {
        return { error: 'invalid' }
      }
      return { value }

    case Date:
      // XLSX has no specific format for dates.
      // Sometimes a date can be heuristically detected.
      // https://github.com/catamphetamine/read-excel-file/issues/3#issuecomment-395770777
      if (value instanceof Date) {
        return { value }
      }
      if (typeof value === 'number') {
        if (!isFinite(value)) {
          return { error: 'invalid' }
        }
        value = parseInt(value)
        const date = parseDate(value, options.properties)
        if (!date) {
          return { error: 'invalid' }
        }
        return { value: date }
      }
      return { error: 'invalid' }

    case Boolean:
      if (typeof value === 'boolean') {
        return { value }
      }
      return { error: 'invalid' }

    default:
      throw new Error(`Unknown schema type: ${type && type.name || type}`)
  }
}
914946
def _parse_bool(value):
    """"""
    if isinstance(value, bool):
        return value

    elif isinstance(value, str):
        if value == 'True':
            return True
        elif value == 'False':
            return False

    raise Exception("Value %s is not boolean." % value)
1174304
function typeOf(value) {
  var returned = Object.prototype.toString.call(value);
  return returned.substring(1, returned.length - 1).split(' ')[1].toLowerCase();
}
1269869
function typedValue(value) {
  if (value[0] == '!') value = value.substr(1)
  var regex = value.match(/^\/(.*)\/(i?)$/);
  var quotedString = value.match(/(["'])(?:\\\1|.)*?\1/);

  if (regex) {
    return new RegExp(regex[1], regex[2]);
  } else if (quotedString) {
    return quotedString[0].substr(1, quotedString[0].length - 2);
  } else if (value === 'true') {
    return true;
  } else if (value === 'false') {
    return false;
  } else if (iso8601.test(value) && value.length !== 4) {
    return new Date(value);
  } else if (!isNaN(Number(value))) {
    return Number(value);
  }

  return value;
}
102767
function(value) {
        switch (typeof value) {
            case 'boolean':
                return 'Boolean';

            case 'number':
                return 'Number';

            case 'string':
                return 'String';

            case 'object':
                if (value === null) {
                    return 'Null';
                } else {
                    switch (Object.prototype.toString.call(value)) {
                        case '[object RegExp]':
                            return 'RegExp';

                        case '[object Array]':
                            return 'Array';

                        case '[object Object]':
                            switch (value.constructor) {
                                case JuttleMoment:
                                    if (value.moment) {
                                        return 'Date';
                                    }
                                    if (value.duration) {
                                        return 'Duration';
                                    }
                                    break;   // silence ESLint

                                case Filter:
                                    return 'Filter';

                                case Object:
                                    return 'Object';
                            }
                    }
                }
        }

        throw new Error('Invalid Juttle value: ' + value + '.');
    }
656968
function(v) {
        if(v === "true") {
            return true;
        } else if(v === "false") {
            return false;
        } else if(v.indexOf("\"") == 0) {
            //remove double quote from value if it's quoted
            return v.substring(1, v.length-1);
        }

        //tryi converting to int if its int
        var i = parseInt(v);
        if(i == v) {
            return i;
        }

        //console.log("not sure how to parse:"+v);
        return v;
    }
770905
@Override
	protected R parseValueFromString(String value)
	{


        value = value.replaceAll("-", "_");
        value = value.replaceAll("^\\s+","");
        value = value.replaceAll("\\s+$","");
		return (R)Enum.valueOf(this.getRange(), value);
	}
839609
function parse(val) {
  if (typeof val === 'number' && !isNaN(val)) {
    return val;
  }

  if (typeof val !== 'string') {
    return null;
  }

  // Test if the string passed is valid
  var results = parseRegExp.exec(val);
  var floatValue;
  var unit = 'b';

  if (!results) {
    // Nothing could be extracted from the given string
    floatValue = parseInt(val, 10);
    unit = 'b'
  } else {
    // Retrieve the value and the unit
    floatValue = parseFloat(results[1]);
    unit = results[4].toLowerCase();
  }

  return Math.floor(map[unit] * floatValue);
}
874690
private String parseValue(String fieldType, Object value) {
		if (TypeConver.isBasicType(fieldType)) {
			if (value != null) {
				return value.toString();
			} else {
				return null;
			}
		}
		return null;
	}
370706
function parseBoolean(value, defaultValue) {
	const v = String(value).trim().toLowerCase();
	if ([ "true", "t", "1", "yes", "y" ].includes(v)) {
		return true;
	}
	else if ([ "false", "f", "0", "no", "n" ].includes(v)) {
		return false;
	}
	else {
		return defaultValue;
	}
}
971287
function () {

// Parse a number value.

            var number,
                string = '';

            if (ch === '-') {
                string = '-';
                next('-');
            }
            while (ch >= '0' && ch <= '9') {
                string += ch;
                next();
            }
            if (ch === '.') {
                string += '.';
                while (next() && ch >= '0' && ch <= '9') {
                    string += ch;
                }
            }
            if (ch === 'e' || ch === 'E') {
                string += ch;
                next();
                if (ch === '-' || ch === '+') {
                    string += ch;
                    next();
                }
                while (ch >= '0' && ch <= '9') {
                    string += ch;
                    next();
                }
            }
            number = +string;
            if (!isFinite(number)) {
                error("Bad number");
            } else {
                return number;
            }
        }
1304478
function typeOf(value) {
            var s = typeof value;
            if(s === 'object') {
                if(value) {
                    if(value instanceof Array) {
                        s = 'array';
                    }
                } else {
                    s = 'null';
                }
            }
            return s;
        }