mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
593 B
28 lines
593 B
9 years ago
|
var getTag = require('./_getTag'),
|
||
|
isObjectLike = require('./isObjectLike');
|
||
|
|
||
|
/** `Object#toString` result references. */
|
||
|
var mapTag = '[object Map]';
|
||
|
|
||
|
/**
|
||
|
* Checks if `value` is classified as a `Map` object.
|
||
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @category Lang
|
||
|
* @param {*} value The value to check.
|
||
|
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||
|
* @example
|
||
|
*
|
||
|
* _.isMap(new Map);
|
||
|
* // => true
|
||
|
*
|
||
|
* _.isMap(new WeakMap);
|
||
|
* // => false
|
||
|
*/
|
||
|
function isMap(value) {
|
||
|
return isObjectLike(value) && getTag(value) == mapTag;
|
||
|
}
|
||
|
|
||
|
module.exports = isMap;
|