Detects real type of the objects like 'Array()', `new Number(1)`, `new Boolean(true)`, etc

@param   {mixed} obj - object to get type of
@param   {object} [options] - object to get type of
@returns {string} precise type
336222
function preciseTypeOf(obj, options)
{
  var type, stamp = Object.prototype.toString.call(obj);

  options = options || {};

  if (!type && obj === undefined) type = 'undefined';
  if (!type && obj === null) type = 'null';

  if (!type && obj.constructor && typeof obj.constructor.isBuffer == 'function' && obj.constructor.isBuffer(obj)) type = 'buffer';

  if (!type && typeof window == 'object' && obj === window) type = 'global';
  if (!type && typeof global == 'object' && obj === global) type = 'global';

  if (!type && typeof obj == 'number' && isNaN(obj)) type = 'nan';
  if (!type && typeof obj == 'object' && stamp == '[object Number]' && isNaN(obj)) type = 'nan';

  if (!type && typeof obj == 'object' && stamp.substr(-6) == 'Event]') type = 'event';
  if (!type && stamp.substr(0, 12) == '[object HTML') type = 'html';
  if (!type && stamp.substr(0, 12) == '[object Node') type = 'html';

  // last resort
  if (!type) type = stamp.match(/\[object\s*([^\]]+)\]/)[1].toLowerCase();

  // be even more precise by reporting "instance of" names
  // Note: only check objects that were created by constructors
  if (type == 'object' && options.pojoOnly && obj.constructor) {
    // some constructors don't have names
    type = obj.constructor.name || 'unknown';

    // preserve `object` response for POJOs
    if (type == 'Object') type = 'object';
  }

  return type;
}
989268
function (val) {
      var valid = [
        'string',  'number', 'integer',
        'boolean', 'object', 'array',
        'null',    'any'
      ];

      valid = (Array.isArray(val) ? val : [val]).every(function (val) {
        return valid.indexOf(val) !== -1;
      });
      if (!valid) {
        throw new(TypeError)("invalid type.");
      }

      this.property.type = val;
      return this;
    }
27183
function isArrayBuffer (obj) {
  return obj instanceof ArrayBuffer ||
    (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&
      typeof obj.byteLength === 'number')
}
24622
function(val) {
	if ( ! val) return false;
	if (typeof(val) === 'number' || typeof(val) === 'boolean') {
		return true;
	}
	if (typeof(val) === 'object' && val.length === undefined) {
		assert(typeof(val) !== 'function', "yessy(function) indicates a mistake: "+val);
		val = Object.getOwnPropertyNames(val);
	}
	if (val.length === 0) {
		return false;
	}
	if (val.length) {
		for (var i = 0; i < val.length; i++) {
			if (val[i]) return true;
		}
		return false;
	}
	return true;
}
261065
public static boolean isNumeric(Object obj) {
		if (obj == null) {
			return false;
		}
		char[] chars = obj.toString().toCharArray();
		int length = chars.length;
		if(length < 1)
			return false;
		
		int i = 0;
		if(length > 1 && chars[0] == '-')
			i = 1;
		
		for (; i < length; i++) {
			if (!Character.isDigit(chars[i])) {
				return false;
			}
		}
		return true;
	}
392203
function isArrayLike(obj){
	var type = typeof obj;
	if(type === "string") {
		return true;
	}
	else if(type === "number") {
		return false;
	}
	// The `in` check is from jQuery’s fix for an iOS 8 64-bit JIT object length bug:
	// https://github.com/jquery/jquery/pull/2185
	var length = obj && type !== 'boolean' &&
		typeof obj !== 'number' &&
		"length" in obj && obj.length;

	// var length = "length" in obj && obj.length;
	return typeof obj !== "function" &&
		( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
79522
function __getType(data, options) {
	let type = typeof data;
	if (data === null) {
		type = DATA_TYPE.NULL;
	}
	else if (type === 'boolean') {
		type = (data) ? DATA_TYPE.TRUE : DATA_TYPE.FALSE;
	}
	else if ( type === "number" ) {
		type = DATA_TYPE.FLOAT64;
	}
	else if ( data instanceof Int8 ) {
		type = DATA_TYPE.INT8;
	}
	else if ( data instanceof UInt8 ) {
		type = DATA_TYPE.UINT8;
	}
	else if ( data instanceof Int16 ) {
		type = DATA_TYPE.INT16;
	}
	else if ( data instanceof UInt16 ) {
		type = DATA_TYPE.UINT16;
	}
	else if ( data instanceof Int32 ) {
		type = DATA_TYPE.INT32;
	}
	else if ( data instanceof UInt32 ) {
		type = DATA_TYPE.UINT32;
	}
	else if ( data instanceof Int64 ) {
		type = DATA_TYPE.INT64;
	}
	else if ( data instanceof UInt64 ) {
		type = DATA_TYPE.UINT64;
	}
	else if ( data instanceof Int256 ) {
		type = DATA_TYPE.INT256;
	}
	else if ( data instanceof UInt256 ) {
		type = DATA_TYPE.UINT256;
	}
	else if ( data instanceof Int512 ) {
		type = DATA_TYPE.INT512;
	}
	else if ( data instanceof UInt512 ) {
		type = DATA_TYPE.UINT512;
	}
	else if ( data instanceof Int128 ) {
		type = DATA_TYPE.INT128;
	}
	else if ( data instanceof UInt128 ) {
		type = DATA_TYPE.UINT128;
	}
	else if ( data instanceof IntVar ) {
		type = DATA_TYPE.INTVAR;
	}
	else if ( data instanceof UIntVar ) {
		type = DATA_TYPE.UINTVAR;
	}
	else if (type === 'string') {
		type = DATA_TYPE.STRING;
	}
	else if (Array.isArray(data)) {
		type = (options.streaming_array === true) ? DATA_TYPE.ARRAY_START : DATA_TYPE.ARRAY;
	}
	else if (data instanceof Date) {
		type = DATA_TYPE.DATE;
	}
	else if (data instanceof ObjectId) {
		type = DATA_TYPE.OBJECTID;
	}
	else if (data instanceof Binary) {
		type = DATA_TYPE.BINARY;
	}
	else if ( data instanceof ArrayBuffer) {
		type = DATA_TYPE.ARRAY_BUFFER;
	}
	else if ( data instanceof DataView) {
		type = DATA_TYPE.DATA_VIEW;
	}
	// NOTE: This line must be prior to Uint8Array since NodeJS Buffer is defined to be inheritance of Uint8Array
	else if ( HAS_NODE_BUFFER && data instanceof Buffer ) {
		type = DATA_TYPE.SPECIAL_BUFFER;
	}
	else if ( data instanceof Uint8Array) {
		type = DATA_TYPE.UINT8_ARRAY;
	}
	else if ( data instanceof Int8Array) {
		type = DATA_TYPE.INT8_ARRAY;
	}
	else if ( data instanceof Uint16Array) {
		type = DATA_TYPE.UINT16_ARRAY;
	}
	else if ( data instanceof Int16Array) {
		type = DATA_TYPE.INT16_ARRAY;
	}
	else if ( data instanceof Uint32Array) {
		type = DATA_TYPE.UINT32_ARRAY;
	}
	else if ( data instanceof Int32Array) {
		type = DATA_TYPE.INT32_ARRAY;
	}
	else if ( data instanceof Float32Array) {
		type = DATA_TYPE.FLOAT32_ARRAY;
	}
	else if ( data instanceof Float64Array) {
		type = DATA_TYPE.FLOAT64_ARRAY;
	}
	else if (type === 'object') {
		type = (options.streaming_object === true) ? DATA_TYPE.OBJECT_START : DATA_TYPE.OBJECT;
	}
	return type;
}
1166790
function guessObjectType(obj, shortname=false) {
  var type
  if (typeof obj === "string" && obj) {
    if (obj in objectTypeUris) {
      // given by URI
      type = objectTypeUris[obj]
    } else {
      // given by name
      obj = obj.toLowerCase().replace(/s$/,"")
      type = Object.keys(objectTypes).find(name => {
        const lowercase = name.toLowerCase()
        if (lowercase === obj || lowercase === "concept" + obj) {
          return true
        }
      })
    }
  } else if (typeof obj === "object") {
    if (obj.type) {
      let types = Array.isArray(obj.type) ? obj.type : [obj.type]
      for (let uri of types) {
        if (uri in objectTypeUris) {
          type = objectTypeUris[uri]
          break
        }
      }
    }
  }
  return (shortname && type) ? type.toLowerCase().replace(/^concept(.+)/, "$1") : type
}
592384
function (obj) {

            var length = !!obj && "length" in obj && obj.length,
                type   = $this.type(obj);

            if (type === "function" || $this.isWindow(obj)) {
                return false;
            }

            return type === "array" ||
                length === 0 ||
                typeof length === "number" &&
                length > 0 &&
                (length - 1) in obj;
        }
582646
function isPrimitiveType (obj) {
  return ( typeof obj === 'boolean' ||
       typeof obj === 'number' ||
       typeof obj === 'string' ||
       obj === null ||
       util.isDate(obj) ||
       util.isArray(obj));
}
1129960
function checkSort(obj) {
  var count = 0
  Object.keys(obj).forEach(key=> {
    if (obj[key] === '**String') count += 1
    if (obj[key] === '**Number') count += 1
  })
  return count <= 1
}
242858
function isArray(obj) {
		var type = sType(obj);
		return (Array.isArray(obj) || (typeof(type) === 'string' && type.substring(0, 5) === 'Array'));
	}
263885
def _jsTypeof(o):
    ''''''
    if o == None:
        return 'object'
    elif o == Undefined:
        return 'undefined'
    elif isinstance(o, bool):
        return 'boolean'
    if isinstance(o, int) or isinstance(o, float):
        return 'number'
    elif isinstance(o, list) or isinstance(o, dict):
        return 'object'
    elif isinstance(o, stringtype):
        return 'string'
    raise ValueError('Unknown type for object %s (%s)' % (o, type(o)))
1252305
function getType(variable) {
        var types = {
            'undefined': 'undefined',
            'number': 'number',
            'boolean': 'boolean',
            'string': 'string',
            '[object Function]': 'function',
            '[object RegExp]': 'regexp',
            '[object Array]': 'array',
            '[object Date]': 'date',
            '[object Error]': 'error'
        };

        return types[typeof variable === 'undefined' ? 'undefined' : _typeof(variable)] || types[{}.toString.call(variable)] || (variable ? 'object' : 'null');
    }
1092587
static boolean isBasicValueType(final Object obj) {
        return obj == null || obj instanceof String || obj instanceof Integer || obj instanceof Boolean
                || obj instanceof Long || obj instanceof Float || obj instanceof Double || obj instanceof Short
                || obj instanceof Byte || obj instanceof Character || obj.getClass().isEnum();
    }
387622
function ( value ) {
            var result = false;
    
            switch ( this.type(value) ) {
                case 'Object':
                    result = true;
                    for ( var key in value ) {
                        result = false;
                        break;
                    }
                    break;
                case 'Array':
                    result = value.length === 0;
                    break;
                case 'Null':
                    result = true;
                    break;
                case 'Undefined':
                    result = true;
                    break;
                case 'String':
                    result = '' === value;
                    break;
            }
    
            return result;
        }
1357763
function isArray(obj) {
    return (obj && typeof obj === OBJECT && typeof obj.length === NUMBER && !(obj.propertyIsEnumerable(LENGTH)));
  }