
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
@js-commons/super-set
Advanced tools
SuperSet class extends Set and add some methods, such as higher-order function.
SuperSet class extends Set and add some methods, such as higher-order function.
$ npm i @js-commons/super-set
or
$ yarn add @js-commons/super-set
const SuperSet = require('@js-commons/super-set')
or
import SuperSet from '@js-commons/super-set'
You can use Set's self methods and below additional methods.
const set = SuperSet.empty()
console.log(set) // {}
const set = SuperSet.of('foo', 'bar')
console.log(set) // { 'foo', 'bar' }
const set = new Set(['foo', 'bar'])
const superSet = SuperSet.from(set)
console.log(superSet) // { 'foo', 'bar' }
const set = SuperSet.of('foo', 'bar')
const tmpArray = []
const peekedSet = set.peek(v => tmpArray.push(v))
console.log(peekedSet) // { 'foo', 'bar' }
console.log(tmpArray) // [ 'foo', 'bar' ]
const set = SuperSet.of('foo', 'bar')
const thisArg = 'baz'
const tmpArray = []
const peekedSet = set.peek(function (v) {
tmpArray.push(v + this)
}, thisArg)
console.log(peekedSet) // { 'foo', 'bar' }
console.log(tmpArray) // [ 'foobaz', 'barbaz' ]
const set = SuperSet.of('foo', 'bar')
const filteredSet = set.filter(v => v.startsWith('f'))
console.log(filteredSet) // { 'foo' }
const set = SuperSet.of('foo', 'bar')
const mappedSet = set.map(v => v + '_')
console.log(mappedSet) // { 'foo_', 'bar_' }
const set = SuperSet.of('foo', 'bar')
const value = set.find(v => v.startsWith('f'))
console.log(value) // foo
onst set = SuperSet.empty()
const value = set.find(v => v.startsWith('f'))
console.log(value) // undefined
const set = SuperSet.of('foo', 'bar')
console.log(set.some(v => v.startsWith('f'))) // true
const set = SuperSet.empty()
console.log(set.some(v => v.startsWith('f'))) // false
const set = SuperSet.of('foo', 'bar')
console.log(set.every(v => v.length === 3)) // true
const set = SuperSet.of('foo', 'bar')
console.log(set.every(v => v.startsWith('f'))) // false
const set = SuperSet.of('foo', 'bar')
console.log(set.isEmpty()) // false
const set = SuperSet.empty()
console.log(set.isEmpty()) // true
const set = SuperSet.of('foo', 'bar')
console.log(set.isNotEmpty()) // true
const set = SuperSet.empty()
console.log(set.isNotEmpty()) // false
const set = SuperSet.of('foo', 'bar')
const values = set.toArray()
console.log(values) // [ 'foo', 'bar' ]
const superSet = SuperSet.of('foo', 'bar')
const set = superSet.toSet()
console.log(set) // { 'foo', 'bar' }
FAQs
SuperSet class extends Set and add some methods, such as higher-order function.
The npm package @js-commons/super-set receives a total of 0 weekly downloads. As such, @js-commons/super-set popularity was classified as not popular.
We found that @js-commons/super-set demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.