PageRenderTime 18ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1var getTag = require('./_getTag'),
 2    isObjectLike = require('./isObjectLike');
 3
 4/** `Object#toString` result references. */
 5var weakMapTag = '[object WeakMap]';
 6
 7/**
 8 * Checks if `value` is classified as a `WeakMap` object.
 9 *
10 * @static
11 * @memberOf _
12 * @since 4.3.0
13 * @category Lang
14 * @param {*} value The value to check.
15 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
16 * @example
17 *
18 * _.isWeakMap(new WeakMap);
19 * // => true
20 *
21 * _.isWeakMap(new Map);
22 * // => false
23 */
24function isWeakMap(value) {
25  return isObjectLike(value) && getTag(value) == weakMapTag;
26}
27
28module.exports = isWeakMap;