1.0.0 • Published 2 years ago

@nyinyithann/uniq.js v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Uniq.js

Uniq.js is a JavaScript library for nodeJS and browser. Uniq.js extends JavaScript Set. The library is heavily inspired and influenced by F# Set module.

Documentation

Please go to Uniq APIs to read more.

Installation

npm install @nyinyithann/uniq.js

Getting started

Uniq extends Set. All built-in methods of Set can be used with Uniq. And Uniq.js provides additional methods.

const somePrimes = new Uniq([2, 3, 5, 7, 11, 13]);
const someEvens = new Uniq([2, 4, 6, 8, 10]);
const evenPrime = somePrimes.intersect(someEvens);
console.log(evenPrime);
// => [Uniq] { 2 }

Uniq has the following methods.

Static Methods

of
empty

Instance Methods

isEmpty
exists
filter
map
fold
foldRight
every
partition
toArray
toMap
intersect
isProperSubsetOf
isProperSupersetOf
isSubsetOf
isSupersetOf
union
difference

Author

Nyi Nyi Than - @nyinyithann

Credit

License

MIT