2.0.0 • Published 12 months ago

spicy-set v2.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
12 months ago

Spicy Set 🔥

Creates Set methods for interacting with objects based on content instead of reference.

Usage

const SpicySet = require('spicy-set');

const vanillaSet = new Set();
const spicySet = new SpicySet();

vanillaSet.add({ hello: 'world' });
spicySet.add({ hello: 'world' });

vanillaSet.has({ hello: 'world' }); // output: false
spicySet.has({ hello: 'world' }); // output: true

vanillaSet.add({ hello: 'world' }); // Adds object, Set is { {hello: 'world'}, {hello: 'world'} }
spicySet.add({ hello: 'world' }); // Doesn't add object, Set is { {hello: 'world'} }

Scripts

  • unit tests: npm test

Help

Why? JavaScript evaluates objects by reference and not value.

2.0.0

12 months ago

1.1.0

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago