Gets the type of the value in lower case.

@param {*} value The value to test.
@returns {string}
356499
function getType(value) {
        // inspired by http://techblog.badoo.com/blog/2013/11/01/type-checking-in-javascript/

        // handle null in old IE
        if (value === null) {
            return 'null';
        }

        // handle DOM elements
        if (value && (value.nodeType === 1 || value.nodeType === 9)) {
            return 'element';
        }

        var s = Object.prototype.toString.call(value);
        var type = s.match(/\[object (.*?)\]/)[1].toLowerCase();

        // handle NaN and Infinity
        if (type === 'number') {
            if (isNaN(value)) {
                return 'nan';
            }
            if (!isFinite(value)) {
                return 'infinity';
            }
        }

        return type;
    }
809312
function(value) {
      switch (typeof value) {
        case 'undefined':
          return this.undefined;
        case 'string':
          return this.string;
        case 'number':
          if (value % 1 === 0) {
            return this.integer;
          } else {
            return this.double;
          }
          break;
        case 'boolean':
          return this.boolean;
        case 'function':
          return this["function"];
        default:
          if (value === null) {
            return this["null"];
          } else if (value instanceof Date) {
            return this.datetime;
          } else if (value instanceof Array) {
            return this.array;
          } else if (Buffer.isBuffer(value)) {
            throw new TypeError("Value cannot be a buffer");
          } else if (value instanceof Object) {
            return this.object;
          } else {
            throw new TypeError('Value must either be a string, integer, double, boolean, date, array, object or function');
          }
      }
    }
895279
function determineType(obj) {
    var type;
    var typeValue;
    var name;

    if (value(obj).typeOf(Object)) {
        type = obj.type || "Object";
    } else {
        type = obj;
    }

    typeValue = value(type);

    if (typeValue.typeOf(String)) {
        name = type.charAt(0).toUpperCase() + type.substring(1);
        return supportedTypes.indexOf(name) === -1 ? "String" : name;
    } else if (typeValue.typeOf(Function)) {
        name = type.toString().match(fnName)[1];
    } else if (typeValue.typeOf(Object)) {
        if (type.type) {
            name = type.type;
        } else {
            return "Object";
        }
    } else {
        name = type.constructor.toString().match(fnName)[1];
    }

    if (supportedTypes.indexOf(name) === -1) {
        throw new TypeError("Type '" + name + "' is not supported");
    }

    return name;
}
224275
function isType(t, str) {
        // This function gets the type of `t`, typeof and instanceof are unreliable (typeof null === 'object')
        return Object.prototype.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase() === str;
    }
792544
function lower (value) {
  if (value === null || value === undefined) {
    return value
  }
  return String.prototype.toLowerCase.call(value)
}
637621
def _value_is_type_text(val):
    
    if ((u'type' in val.keys()) and
            (val['type'].lower() == u"text")):
        return True
    return False
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;
}
556240
function(str) {
      var type, res;

      str = str || '';
      res = str.match(/(uncaught)?\s?(\w+)\:/i);
      type = (res) ? res[2] : null;

      return type;
    }
1035410
function(value) {

		var result = '';

		if (value) {
			result = value.toString();
			result = result[0].toUpperCase() + result.substr(1);
		}

		return result;

	}
220408
private function guess_type($value)
    {
        $type = 'string';

        // array requires hint to be passed.

        if (preg_match('/^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/', $value)) {
            $type = 'double';
        }
        else if (preg_match('/^\d+$/', $value)) {
            $type = 'integer';
        }
        else if (preg_match('/^(t(rue)?)|(f(alse)?)$/i', $value)) {
            $type = 'boolean';
        }

        return $type;
    }
621296
public static String typeof(Object value)
    {
        if (value == null)
            return "object";
        if (value == Undefined.instance)
            return "undefined";
        if (value instanceof ScriptableObject)
            return ((ScriptableObject) value).getTypeOf();
        if (value instanceof Scriptable)
            return (value instanceof Callable) ? "function" : "object";
        if (value instanceof CharSequence)
            return "string";
        if (value instanceof Number)
            return "number";
        if (value instanceof Boolean)
            return "boolean";
        throw errorWithClassName("msg.invalid.type", value);
    }
56173
function formatValue(value) {
		
		var out;
		var type = util.sType(value);
		
		// if there is a type, check all sub items for types
		if (_.has(value, 'attributes.type') && _.has(value, '$value') && _.keys(value).length === 2) {
			out = util.moRef(value);
		}
		else if (type) {
			if (util.isArray(value)) {
				out = [];
				
				var subtype = type;
				
				if (subtype.match(/^ArrayOf/)) {
					subtype = subtype.replace(/^ArrayOf/, '');

					if (!Array.isArray(_.get(value, subtype)) && value[subtype]) {
						value[subtype] = [value[subtype]];
					}
				}
				
				_.forEach(value[_.keys(value)[1]], function(obj) {
					out.push(formatValue(obj));
				});
			}
			else if (util.isBoolean(value)) {
				
				// check for valid true values, otherwise false
				if (_.includes(['1', 'true'], _.lowerCase(value.$value))) {
					out = true;
				}
				else {
					out = false;
				}
			}
			else if (util.isInt(value)) {
				out = Number(value.$value);
			}
			else if (_.has(value, '$value')) {
				out = value.$value;
			}
			else {
				out = formatValue(_.omit(value, 'attributes'));
			}
			
		}
		else if (Array.isArray(value)) {
			out = [];
			_.forEach(value, function(val) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out.push(formatValue(val));
				}
				else {
					out.push(cast(val));
				}
			});
		}
		else if (util.hasKeys(value)) {
			out = {};
			_.forEach(value, function(val, key) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out[key] = formatValue(val);
				}
				else {
					out[key] = cast(val);
				}
			});
		}
		else {
			out = cast(value);
		}
		return out;
	}
1347407
function caseInsensitivePart(value) {
    let result = [];
    for(let i=0; i<value.length; i++) {
        const c = value[i];
        const l = c.toLowerCase();
        const u = c.toUpperCase();

        if(l !== u) {
            result.push('[' + l + u + ']');
        } else {
            result.push(l);
        }
    }
    return result.join('');
}
719075
public static function typeOfValue($value)
    {
        if (is_null($value)) {
            return self::TYPE_NULL;
        }
        if (is_int($value)) {
            return self::TYPE_INT;
        }
        if (is_bool($value)) {
            return self::TYPE_BOOL;
        }
        return self::TYPE_STR;
    }
716868
function getClassOf(value) {
    return value == null
      ? capitalize(value)
      : toString.call(value).slice(8, -1);
  }
891767
public static int getTypeForValue( Object value ) {
        if (value == null) return Type.NULL;
        if (value instanceof String) return Type.STRING;
        if (value instanceof Symbol) return Type.SYMBOL;
        if (value instanceof Integer) return Type.INT32;
        if (value instanceof Long) return Type.INT64;
        if (value instanceof Double) return Type.DOUBLE;
        if (value instanceof List) return Type.ARRAY;
        if (value instanceof Document) return Type.DOCUMENT;
        if (value instanceof Boolean) return Type.BOOLEAN;
        if (value instanceof Binary) return Type.BINARY;
        if (value instanceof ObjectId) return Type.OBJECTID;
        if (value instanceof Date) return Type.DATETIME;
        if (value instanceof Null) return Type.NULL;
        if (value instanceof Pattern) return Type.REGEX;
        if (value instanceof Symbol) return Type.DBPOINTER;
        if (value instanceof Code) return Type.JAVASCRIPT;
        if (value instanceof CodeWithScope) return Type.JAVASCRIPT_WITH_SCOPE;
        if (value instanceof Timestamp) return Type.TIMESTAMP;
        if (value instanceof MinKey) return Type.MINKEY;
        if (value instanceof MaxKey) return Type.MAXKEY;
        return Type.UNDEFINED;
    }
956328
function ( value ) {
            var result = Object.prototype.toString.call( value );
            result = result.match( /^\[\W*object\W+([a-zA-Z]+)\W*\]$/ );
    
            if ( result && result.length > 1 ) {
                result = result[1];
            }
    
            if ( result === 'String' ) {
                if ( $B.color.is(value) ) {
                    result = 'Color';
                }
            } else if ( result === 'Number' ) {
                if ( isNaN(value) ) {
                    result = 'NaN';
                }
            } else if ( result === 'Object' ) {
                if ( this.isUndefined(value) ) {
                    result = 'Undefined';
                } else if ( this.isNull(value) ) {
                    result = 'Null';
                } else if ( this.isElement(value) ) {
                    result = 'Element';
                }
            } else {
                if ( this.isElement(value) ) {
                    result = 'Element';
                }
            }
    
            return result;
        }