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.
29 lines
631 B
29 lines
631 B
1 month ago
|
var getTag = require('./_getTag'),
|
||
|
isObjectLike = require('./isObjectLike');
|
||
|
|
||
|
/** `Object#toString` result references. */
|
||
|
var weakMapTag = '[object WeakMap]';
|
||
|
|
||
|
/**
|
||
|
* Checks if `value` is classified as a `WeakMap` object.
|
||
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @since 4.3.0
|
||
|
* @category Lang
|
||
|
* @param {*} value The value to check.
|
||
|
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
|
||
|
* @example
|
||
|
*
|
||
|
* _.isWeakMap(new WeakMap);
|
||
|
* // => true
|
||
|
*
|
||
|
* _.isWeakMap(new Map);
|
||
|
* // => false
|
||
|
*/
|
||
|
function isWeakMap(value) {
|
||
|
return isObjectLike(value) && getTag(value) == weakMapTag;
|
||
|
}
|
||
|
|
||
|
module.exports = isWeakMap;
|