dotfiles/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isWeakSet.js

38 lines
873 B
JavaScript
Raw Normal View History

2016-09-11 09:29:13 +01:00
var isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var weakSetTag = '[object WeakSet]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && objectToString.call(value) == weakSetTag;
}
module.exports = isWeakSet;