1 | import getTag from './_getTag';
|
2 | import isObjectLike from './isObjectLike';
|
3 |
|
4 | /** `Object#toString` result references. */
|
5 | var setTag = '[object Set]';
|
6 |
|
7 | /**
|
8 | * Checks if `value` is classified as a `Set` 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 correctly classified,
|
16 | * else `false`.
|
17 | * @example
|
18 | *
|
19 | * _.isSet(new Set);
|
20 | * // => true
|
21 | *
|
22 | * _.isSet(new WeakSet);
|
23 | * // => false
|
24 | */
|
25 | function isSet(value) {
|
26 | return isObjectLike(value) && getTag(value) == setTag;
|
27 | }
|
28 |
|
29 | export default isSet;
|