1.4.0 • Published 3 years ago

@jlguenego/set v1.4.0

Weekly downloads
41
License
ISC
Repository
-
Last release
3 years ago

Set

Set utility in Javascript (and Typescript).

Set are native in Javascript (since ES6). But the supported operations are limited. No union, intersection, include, etc. This library tries to provide all missing basic functions.

This library covers the concept exposed in the 1972 book from Aho & Ullman, The Theory of Parsing, Translation, and Compiling.

Install

npm i @jlguenego/set

This library exposes both:

  • ES2015 module that can be tree-shaked by Webpack for Angular etc.
  • CommonJS module for traditionnal node way.

It is ready to use for both browsers and node app.

Usage

const a = new Set([1, 2, 3]);
const b = new Set([3, 4, 5]);
const c = Sets.union(a, b);
const d = new Set([1, 2, 3, 4, 5]);
assert(Sets.areEquals(c, d));
const e = Sets.intersection(a, b);
const f = new Set([3]);
assert(Sets.areEquals(e, f));
// etc.

API

See the typedoc documentation

Examples

See all examples in the test suite.

Participating

Do not hesitate to bring your contribution to this project. Fork and Pull Request are welcome.

Bibliography

License

ISC

Author

Jean-Louis GUENEGO jlguenego@gmail.com

1.4.0

3 years ago

1.2.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago