
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
arraysetjs
Advanced tools
A dependency-free library for treating arrays like sets and performing [set operations](<https://en.wikipedia.org/wiki/Set_(mathematics)#Basic_operations>) with an intuitive interface.
A dependency-free library for treating arrays like sets and performing set operations with an intuitive interface.
This library also includes a mutable version (ideal for use with Automerge or Immer).
import set from 'arraysetjs'
// existence:
set([1, 2, 3]).contains(2) // true
set([1, 2, 3]).contains(4) // false
// add/remove elements:
set([1, 2, 3]).add(4) // [1, 2, 3, 4]
set([1, 2, 3]).remove(2) // [1, 3]
// union:
set([1, 2, 3]).union([4, 5, 6]) // [1, 2, 3, 4, 5, 6]
set([1, 2, 3]).union([3, 4, 5]) // [1, 2, 3, 4, 5]
// intersection:
set([1, 2, 3]).intersection([4, 5, 6]) // []
set([1, 2, 3]).intersection([3, 4, 5]) // [3]
// difference:
set([1, 2, 3]).minus([1, 3]) // [2]
// create an arrayset instance:
set.fromArray([1, 2, 3, 2, 3]) // [1, 2, 3]
The interface for mutable usage is exactly the same except the source array is modified. For example:
import set from 'arraysetjs'
const a = [1, 2, 3]
set.mutable(a).union([3, 4]) // a is now [1, 2, 3, 4]
// (which is also returned)
This is a small library without a lot of activity, so generally I'll accept any reasonable enhancements. If there are big changes you would like to see, please raise an issue first to discuss.
pnpm test
)pnpm build
)Do not update CHANGELOG.md; the maintainer will do that with version releases.
FAQs
A dependency-free library for treating arrays like sets and performing [set operations](<https://en.wikipedia.org/wiki/Set_(mathematics)#Basic_operations>) with an intuitive interface.
The npm package arraysetjs receives a total of 0 weekly downloads. As such, arraysetjs popularity was classified as not popular.
We found that arraysetjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.