Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

superset

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superset

A library that provides the missing Set methods such as map and filter.

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
758
-23.2%
Maintainers
1
Weekly downloads
 
Created
Source

superset NPM version Build Status Coverage Status

A library for ES6 that extends the built-in Set class to implement the missing fundamental methods such as map(), filter() and reduce() in addition to basic set methods such as union() and isSubsetOf().

Install from NPM

npm install superset --save

Use

"use strict";

const SuperSet = require("superset");
const numbers = new SuperSet([1, 2, 3, 4, 5]);
const evenNumbers = numbers.filter(num => num % 2 === 0);  // SuperSet { 2, 4 }

evenNumbers.isSubsetOf(numbers);  // true

numbers.diff(evenNumbers);  // SuperSet { 1, 3, 5 }

Docs

You can check out the docs or refer to the Array methods on MDN for further information. The code is also documented using JSDoc.

Keywords

Set

FAQs

Package last updated on 02 Dec 2020

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