1.1.1 • Published 10 years ago

superhash v1.1.1

Weekly downloads
30
License
MIT
Repository
github
Last release
10 years ago

SuperHash

Build Status Coverage Status Code Climate

superhash

HashMap that supports using one or more keys of any type*

Hash keys are generated using multikey-hash

Installation

$ npm install superhash

Examples

var SuperHash = require('superhash');
var hashMap = new SuperHash();
var data = 'value';

Single key:

hashMap.set(/.*/g, data);
hashMap.get("/.*/g"); // returns undefined
hashMap.get(/.*/g); // returns 'value'
hashMap.delete(/.*/g); // returns true

Multiple keys:

hashMap.set(1,{ name: 'foo' }, true, data);
hashMap.get(1,{ name: 'foo' }, "true"); // returns undefined
hashMap.get(1,{ name: 'foo' }, true); // returns 'value'
hashMap.delete(1,{ name: 'foo' }, true); // returns true

API

See API.md

FAQ

What types of keys can be used?

Any primitive or mutable object can be used as a key.

Who named this module?

@nik

LICENSE

MIT

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

11 years ago

0.0.4

11 years ago