JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 567
  • Score
    100M100P100Q94711F
  • License MIT

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

Package Exports

  • superset

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (superset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.