/node_modules/lodash/isWeakMap.js
https://bitbucket.org/coleman333/smartsite · JavaScript · 28 lines · 7 code · 3 blank · 18 comment · 2 complexity · 7e4d3194612d4ad0bcc885f7705c4368 MD5 · raw file
- 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;