Skip to content

Repository files navigation

SuperHash

Build StatusCoverage StatusCode 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

varSuperHash=require('superhash');varhashMap=newSuperHash();vardata='value';

Single key:

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

Multiple keys:

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

About

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

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages