<commit_before>ImmuFunc
========

> Effective functions to keep data structure immutable

[![Build Status](https://travis-ci.org/clitetailor/immu-func.svg?branch=master)](https://travis-ci.org/clitetailor/immu-func)

Install
-------

```bash
npm install --save immu-func
```

Getting Started
---------------

### Node

```javascript
let immu = require('immu-func');
```

### Babel

```javascript
import { setIn } from 'immu-func';

const a = { b: [0, 1, 2, { c: 5 }] }

console.log(setIn(a, ['b', 3, 'c'], 6));
// => { b: [ 0, 1, 2, { c: 6 } ] }
```

Modify State Tree
-----------------

```javascript
import { modifyIn, assign } from 'immu-func';

const stateTree = { a: { b: { c: 5 } } };

const branch = ['a', 'b'];
const newState = { c: 6 };

const newStateTree = modifyIn(stateTree, branch, state => assign(state, newState));

console.log(newStateTree);
// => { a: { b: { c: 6 } } }
```

Polyfill
--------

```javascript
import 'immu-func/polyfill';

const obj1 = { a: { b: 5 } };
const obj2 = obj1.setIn(['a', 'b'], 6);

console.log(obj2);
// => { a: { b: 6 } }
```

```javascript
import 'immu-func/polyfill';

const obj1 = { a: { b: 5 } };
const obj2 = obj1.setIn(['a', 'b'], 6);

console.log(obj2);
// => { a: { b: 6 } }
```

API Reference
-------------<commit_msg>update: README<commit_after>ImmuFunc
========

> Effective functions to keep data structure immutable

[![Build Status](https://travis-ci.org/clitetailor/immu-func.svg?branch=master)](https://travis-ci.org/clitetailor/immu-func)

Install
-------

```bash
npm install --save immu-func
```

Getting Started
---------------

### Node

```javascript
let immu = require('immu-func');
```

### Babel

```javascript
import { setIn } from 'immu-func';

const a = { b: [0, 1, 2, { c: 5 }] }

console.log(setIn(a, ['b', 3, 'c'], 6));
// => { b: [ 0, 1, 2, { c: 6 } ] }
```

Modify State Tree
-----------------

```javascript
import { modifyIn, assign } from 'immu-func';

const stateTree = { a: { b: { c: 5 } } };

const branch = ['a', 'b'];
const newState = { c: 6 };

const newStateTree = updateIn(stateTree, branch, state => assign(state, newState));

console.log(newStateTree);
// => { a: { b: { c: 6 } } }
```

Polyfill
--------

```javascript
import 'immu-func/polyfill';

const obj1 = { a: { b: 5 } };
const obj2 = obj1.setIn(['a', 'b'], 6);

console.log(obj2);
// => { a: { b: 6 } }
```

```javascript
import 'immu-func/polyfill';

const obj1 = { a: { b: 5 } };
const obj2 = obj1.setIn(['a', 'b'], 6);

console.log(obj2);
// => { a: { b: 6 } }
```

API Reference
-------------
{'fraction_non_alphanumeric': 0.2681586179819395, 'fraction_numerical': 0.02120141342756184, 'mean_word_length': 2.9565217391304346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2288817', 'n_tokens_mistral': 1042, 'n_tokens_neox': 975, 'n_words': 241}