🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

is-set

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
i

is-set

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

2.0.3
latest
67

Supply Chain Security

100

Vulnerability

82

Quality

51

Maintenance

100

License

Socket optimized override available

Maintenance

Package can be replaced with a Socket optimized override.

Found 1 instance in 1 package

Version published
Weekly downloads
31M
9.78%
Maintainers
1
Weekly downloads
 
Created
Issues
1

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

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