mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
29 lines
629 B
JavaScript
29 lines
629 B
JavaScript
|
import getTag from './_getTag.js';
|
||
|
import isObjectLike from './isObjectLike.js';
|
||
|
|
||
|
/** `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;
|
||
|
}
|
||
|
|
||
|
export default isWeakMap;
|