0.0.6 • Published 8 years ago
@nathanfaucett/immutable-hash_map v0.0.6
Immutable HashMap
Immutable persistent hash map for the browser and node.js
Install using npm
$ npm install @nathanfaucett/immutable-hash_map --saveInstall using yarn
$ yarn add @nathanfaucett/immutable-hash_map --saveExample Usage
var ImmutableHashMap = require("@nathanfaucett/immutable-hash_map");
var a = new ImmutableHashMap({0: 0, 1: 1}),
b = new ImmutableHashMap(0, 0, 1, 1),
c = ImmutableHashMap.of({0: 0, 1: 1}),
d = ImmutableHashMap.of(0, 0, 1, 1);
var a0 = a.set(2, 2),
a1 = a.remove(1);Docs
Members
length -> Number
returns size of HashMap, only available if Object.defineProperty is supportedStatic Functions
HashMap.isHashMap(value: Any) -> Boolean
returns true if value is a hash map else falseHashMap.of(...values: Array) -> HashMap
creates HashMap from passed values same as new HashMap(...values: Array<Any>)HashMap.equal(a: HashMap, b: HashMap) -> Boolean
compares hash maps by valuesFunctions
size() -> Number
returns size of HashMapget(key: Any) -> Any
returns value at keyhas(key: Any) -> Boolean
returns true if hash map contains keyset(key: Any, value: Any) -> HashMap
returns new HashMap if value at key is not set or differentremove(key: Any) -> HashMap
returns new HashMap without the value at keyiterator(reverse = false: Boolean) -> Iterator
returns IteratortoArray() -> Array<Any, Any>
returns HashMap elements in an ArraytoObject() -> Object<String, Any>
returns HashMap elements in an Object, keys should be primitives or some key value pairs will be lostjoin(separator = " ") -> String
join all elements of an HashMap into a StringtoString() -> String
String representation of HashMapequals(other: HashMap) -> Boolean
compares this hash map to other hash map by valuesevery, filter, forEach, forEachRight, map, reduce, reduceRight, some
some common methods