rkatic-update
Advanced tools
Comparing version 1.0.0 to 1.0.3
{ | ||
"name": "rkatic-update", | ||
"version": "1.0.0", | ||
"version": "1.0.3", | ||
"description": "Utility for immutable deep updates of objects.", | ||
@@ -10,7 +10,6 @@ "main": "lib", | ||
"build": "npm run test && babel src -d lib", | ||
"preversion": "npm run build", | ||
"postversion": "git push && git push --tags" | ||
"preversion": "npm run build" | ||
}, | ||
"engines": { | ||
"node": "8" | ||
"node": ">=7" | ||
}, | ||
@@ -31,5 +30,5 @@ "repository": { | ||
], | ||
"author": "Robert Katić", | ||
"author": "Blazing Edge", | ||
"license": "MIT", | ||
"homepage": "https://github.com/rkatic/update#readme", | ||
"homepage": "https://blog.blazingedge.io", | ||
"devDependencies": { | ||
@@ -36,0 +35,0 @@ "babel-cli": "^6.26.0", |
@@ -1,41 +0,1 @@ | ||
[![Build Status](https://travis-ci.org/blazing-edge-labs/update.svg?branch=master)](https://travis-ci.org/blazing-edge-labs/update) | ||
# update | ||
Yet another utility for immutable object updates. | ||
## Installation | ||
`npm install rkatic-update --save` | ||
## Usage | ||
```js | ||
const newState = update(state, 'path.to.users[7].balance', { | ||
email: 'some.email@example.com', | ||
balance: { | ||
amount: n => n + 100 | ||
} | ||
}) | ||
``` | ||
More examples in the [article](https://blog.blazingedge.io/immutable-update/). | ||
## API | ||
### `update(data, [path], change)` | ||
#### Arguments | ||
* **data *(any)***: The data to update. | ||
* **[path] *(Array | string)***: The path of the property to update. | ||
* **change *(any)***: The change to apply. | ||
#### Returns | ||
Updated data. When no effective changes are made, returns the same `data`. | ||
### `REMOVE` | ||
Special value to use in a **change** to remove part(s) of **data**. | ||
# Moved to [@blazingedge/update](https://www.npmjs.com/package/@blazingedge/update) |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
17604
1
2