New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

is-set

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-set

Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16M
decreased by-33.62%
Maintainers
1
Weekly downloads
 
Created

What is is-set?

The `is-set` npm package is designed to provide a simple and efficient way to check if a given value is a Set object. This can be particularly useful when working with collections of unique values and you need to ensure that the data structure being manipulated or checked is indeed a Set.

What are is-set's main functionalities?

Check if a value is a Set

This feature allows you to verify if a given value is an instance of a Set. It is particularly useful when you need to differentiate between Set objects and other iterable or collection types in JavaScript, such as Arrays, Objects, or even WeakSets. The code sample demonstrates how to use `is-set` to check various values, showing that it correctly identifies Set instances and distinguishes them from other types.

"use strict";\nconst isSet = require('is-set');\n\nconsole.log(isSet(new Set())); // true\nconsole.log(isSet(new WeakSet())); // false\nconsole.log(isSet([1, 2, 3])); // false\nconsole.log(isSet({})); // false\nconsole.log(isSet(undefined)); // false"

Other packages similar to is-set

Keywords

FAQs

Package last updated on 08 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc