Sha256: 19860a4dcaa1dd6ba506ca3090b9827eb577e831332db070866cb8edbfc66a3b
Contents?: true
Size: 711 Bytes
Versions: 167
Compression:
Stored size: 711 Bytes
Contents
/** * toString ref. */ var toString = Object.prototype.toString; /** * Return the type of `val`. * * @param {Mixed} val * @return {String} * @api public */ module.exports = function(val){ switch (toString.call(val)) { case '[object Function]': return 'function'; case '[object Date]': return 'date'; case '[object RegExp]': return 'regexp'; case '[object Arguments]': return 'arguments'; case '[object Array]': return 'array'; case '[object String]': return 'string'; } if (val === null) return 'null'; if (val === undefined) return 'undefined'; if (val && val.nodeType === 1) return 'element'; if (val === Object(val)) return 'object'; return typeof val; };
Version data entries
167 entries across 94 versions & 1 rubygems