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.

30 lines
613 B

var getTag = require('./_getTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
function isSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
module.exports = isSet;