Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
exotic / src / types / collection / isSet.ts
Size: Mime:
import { toStringTag } from '../kind'

/**
 * Checks if `value` is classified as a `Set` object.
 *
 * @since 4.3.0
 * @category Lang
 * @param {*} x The value to check.
 * @return {boolean} Returns `true` if `value` is a set, else `false`.
 *
 * @TODO map[Symbol.species] === Set
 *
 * @example
 *
 *   isSet(new Set)
 *   //=> true
 *
 *   isSet(new WeakSet)
 *   //=> false
 *
 */
function isSet(x: any): x is Set<any> {
  // return x instanceof Set || toS(x) === '[object Set]'
  return toStringTag(x) === '[object Set]'
}
// x instanceof Set ||

export { isSet }
export default isSet