Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@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 2 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.