object-hashmap

1.0.6 • Public • Published

object-hashmap

object-hashmap is a map util of the form Map<K,V> where K i.e. key and V i.e. value can be either object or primitive data type.

Example usage

JS:

var objectHashMap = require('object-hashmap');
var hashMap = new objectHashMap.ObjectHashMap();

hashMap.put("key1", { test: "key1" });
hashMap.put({ key: "key2" }, { test: "key2" });
hashMap.put({ key: "key2" }, { test: "key3" });
console.log(hashMap.toString());

Installation

Node:

npm install object-hashmap

Methods

//Inserts an element in the map
put(K,V)

//Gets Value asssociated with given key or undefined if there is no such key
get(K)

//Returns String representation of the Map Object
toString()

/object-hashmap/

    Package Sidebar

    Install

    npm i object-hashmap

    Weekly Downloads

    25

    Version

    1.0.6

    License

    ISC

    Last publish

    Collaborators

    • paragbhadoria