# @nathanfaucett/immutable-hash_map

> immutable persistent hash_map for the browser and node.js

Latest version **0.0.6** (published 2017-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nathanfaucett/immutable-hash_map
pnpm add @nathanfaucett/immutable-hash_map
yarn add @nathanfaucett/immutable-hash_map
bun add @nathanfaucett/immutable-hash_map
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2017-11-05 |
| First published | 2016-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nathan Faucett |
| Maintainers | nathanfaucett |
| Keywords | immutable-hash_map, immutable-hash_map.js |

## Links

- npm: https://www.npmjs.com/package/@nathanfaucett/immutable-hash_map
- Repository: https://github.com/nathanfaucett/immutable-hash_map
- Homepage: https://github.com/nathanfaucett/immutable-hash_map#readme
- Issues: https://github.com/nathanfaucett/immutable-hash_map/issues
- npm.io page: https://npm.io/package/@nathanfaucett/immutable-hash_map

## Dependencies (14)

- [@nathanfaucett/has](https://npm.io/package/@nathanfaucett/has.md) 0.0.2
- [@nathanfaucett/freeze](https://npm.io/package/@nathanfaucett/freeze.md) 0.0.1
- [@nathanfaucett/is_null](https://npm.io/package/@nathanfaucett/is_null.md) 0.0.1
- [@nathanfaucett/inherits](https://npm.io/package/@nathanfaucett/inherits.md) 0.0.3
- [@nathanfaucett/is_equal](https://npm.io/package/@nathanfaucett/is_equal.md) 0.0.1
- [@nathanfaucett/iterator](https://npm.io/package/@nathanfaucett/iterator.md) 0.0.2
- [@nathanfaucett/bit_count](https://npm.io/package/@nathanfaucett/bit_count.md) 0.0.2
- [@nathanfaucett/hash_code](https://npm.io/package/@nathanfaucett/hash_code.md) 0.0.3
- [@nathanfaucett/is_object](https://npm.io/package/@nathanfaucett/is_object.md) 0.0.1
- [@nathanfaucett/array_copy](https://npm.io/package/@nathanfaucett/array_copy.md) 0.0.1
- [@nathanfaucett/is_array_like](https://npm.io/package/@nathanfaucett/is_array_like.md) 0.0.2
- [@nathanfaucett/fast_bind_this](https://npm.io/package/@nathanfaucett/fast_bind_this.md) 0.0.1
- [@nathanfaucett/define_property](https://npm.io/package/@nathanfaucett/define_property.md) 0.0.3
- [@nathanfaucett/is_null_or_undefined](https://npm.io/package/@nathanfaucett/is_null_or_undefined.md) 0.0.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2017-11-05
- 0.0.5 — 2017-10-30
- 0.0.4 — 2017-09-19
- 0.0.3 — 2017-04-01
- 0.0.2 — 2016-10-05
- 0.0.1 — 2016-07-15

## README

Immutable HashMap
=======

Immutable persistent hash map for the browser and node.js

# Install using npm
```bash
$ npm install @nathanfaucett/immutable-hash_map --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-hash_map --save
```

# Example Usage
```javascript
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 supported


## Static Functions

#### HashMap.isHashMap(value: Any) -> Boolean
    returns true if value is a hash map else false

#### HashMap.of(...values: Array<Any>) -> HashMap
    creates HashMap from passed values same as new HashMap(...values: Array<Any>)

#### HashMap.equal(a: HashMap, b: HashMap) -> Boolean
    compares hash maps by values


## Functions

#### size() -> Number
    returns size of HashMap

#### get(key: Any) -> Any
    returns value at key

#### has(key: Any) -> Boolean
    returns true if hash map contains key

#### set(key: Any, value: Any) -> HashMap
    returns new HashMap if value at key is not set or different

#### remove(key: Any) -> HashMap
    returns new HashMap without the value at key

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### toArray() -> Array<[Any, Any]>
    returns HashMap elements in an Array

#### toObject() -> Object<String, Any>
    returns HashMap elements in an Object, keys should be primitives or some key value pairs will be lost

#### join([separator = " "]) -> String
    join all elements of an HashMap into a String

#### toString() -> String
    String representation of HashMap

#### equals(other: HashMap) -> Boolean
    compares this hash map to other hash map by values

#### every, filter, forEach, forEachRight, map, reduce, reduceRight, some
    some common methods

---
_Source: https://npm.io/package/@nathanfaucett/immutable-hash_map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
