object-path-immutable
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "object-path-immutable", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Modify deep object properties without modifying the original object (immutability). Works great with React and Redux.", | ||
@@ -5,0 +5,0 @@ "author": "Mario Casciaro <mariocasciaro@gmail.com>", |
@@ -16,6 +16,13 @@ [![build](https://img.shields.io/travis/mariocasciaro/object-path-immutable.svg?style=flat-square)](https://travis-ci.org/mariocasciaro/object-path-immutable) | ||
## Changelog | ||
### 1.0 | ||
- **Breaking change**: The way the library handles empty paths has changed. Before this change,all the methods were returning the original object. The new behavior is as follows: | ||
- | ||
- **Breaking change**: The way the library handles empty paths has changed. Before this change,all the methods were returning the original object. The new behavior is as follows. | ||
- `set(src, path, value)`: `value` is returned | ||
- `update(src, path, updater)`: `value` will be passed to `updater()` and the result returned | ||
- `set(src, path, ...values)`: `values` will be concatenated to `src` if `src` is an array, otherwise `values` will be returned | ||
- `insert(src, path, value, at)`: if `src` is an array then it will be cloned and `value` will be inserted at `at`, otherwise `[value]` will be returned | ||
- `del(src, path)`: returns `undefined` | ||
- `assign(src, path, target)`: Target is assigned to a clone of `src` and returned | ||
## Install | ||
@@ -22,0 +29,0 @@ |
24764
207