2.2.2 • Published 10 months ago

object-set-type v2.2.2

Weekly downloads
6,614
License
MIT
Repository
github
Last release
10 months ago

object-set-type

Downloads Version@npm Version@git CI Docs

A Set implementation that supports Objects and custom conditions.

Usage

const ObjectSet = require('object-set-type');

const set = new ObjectSet();
set.add(1);
set.add('Hello');
set.add({
    a: 1
});
set.add({
    a: 1
});

console.log(set.size); // 3
Array.from(set); // 1, "Hello", {a: 1}

Custom comparison logic

The equals(a,b) method is responsible for comparing two items, and the set logic is based on this. This method can be overwritten to support custom uniqueness logic, e.g., handle objects, but compare only specific properties.

Documentation

For detailed documentation see the TypeDocs documentation.

2.2.2

10 months ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

6 years ago

1.0.0

6 years ago