# isSet

# Description

检查 value 是否是一个 Set 对象。

# Params

value

# Return

Boolean

# Depend

import getTag from './.internal/getTag.js'
import isObjectLike from './isObjectLike.js'
import nodeTypes from './.internal/nodeTypes.js'

getTag 源码分析

isObjectLike 源码分析

nodeTypes 源码分析

# Code

const nodeIsSet = nodeTypes && nodeTypes.isSet
const isSet = nodeIsSet
  ? (value) => nodeIsSet(value)
  : (value) => isObjectLike(value) && getTag(value) == '[object Set]'

# Analyze

isArrayBuffer 类似,具体不在赘述

# Example

isSet(new Set)
// => true

isSet(new WeakSet)
// => false