Skip to content

Latest commit

 

History

History
executable file
·
59 lines (42 loc) · 1.35 KB

README.md

File metadata and controls

executable file
·
59 lines (42 loc) · 1.35 KB

SuperHash

Build Status Coverage Status Code Climate

superhash

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

Hash keys are generated using esco/multikey-hash

Installation

$ npm install superhash

Examples

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

Single key:

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

Multiple keys:

var obj = { name: 'foo' };
hashMap.set(1, obj, true, data);
hashMap.get(1, obj, "true"); // returns undefined
hashMap.get(1, obj, true); // returns 'value'
hashMap.delete(1, obj, 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