1.1.0 • Published 6 years ago

spicy-set v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years 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 = SpicySet();

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

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

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

Scripts

  • unit tests: npm test
  • html test coverage: npm run html
  • build and view docs: npm run docs

Help

Why? JavaScript evaluates objects by reference and not value.

1.1.0

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago