object-diff
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "object-diff", | ||
"description": "Get the diff from objectA to objectB", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "index.js", | ||
@@ -17,4 +17,5 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "^3.0.0", | ||
"extend": "^2.0.0" | ||
"tape": "^3.2.0", | ||
"extend": "^2.0.0", | ||
"testling": "^1.7.1" | ||
}, | ||
@@ -21,0 +22,0 @@ "testling": { |
# object diff | ||
Get the minimal patch to extend objectA with to transform it into | ||
objectB | ||
Get the minimal patch to extend objectA with to transform it into objectB | ||
[![npm version][npm-image]][npm-url] | ||
Consider an object retrieved from a server: | ||
@@ -16,4 +17,4 @@ | ||
Now the user changes stuff using some frontend (e.g. a HTML form) and | ||
ends with: | ||
Now the user changes stuff using some frontend (e.g. a HTML form) and ends | ||
with: | ||
@@ -28,9 +29,9 @@ ```js | ||
When he hits save, you only want to send off the changed parts to the | ||
server, to save bits (because you'r indeed a programmer), but also to | ||
avoid any unnecessary "merge conflicts" at the server. | ||
When he hits save, you only want to send off the changed parts to the servers, | ||
to save bits (because you're indeed a programmer), but also to avoid any | ||
unnecessary "merge conflicts" at the server. | ||
Imagine two users changing the same object; if they did not change the | ||
exact same keys of the object, the last user won't erase the first | ||
user's changes - in a lot of cases, that's the expected behavior. | ||
Imagine two users changing the same object; if they did not change the exact | ||
same keys of the object, the last user won't erase the first user's changes - | ||
in a lot of cases, that's the expected behavior. | ||
@@ -46,3 +47,3 @@ ## Install | ||
```js | ||
var objectDiff = require('object-diff'); | ||
var diff = require('object-diff'); | ||
@@ -63,3 +64,3 @@ var a = { | ||
objectDiff(a, b); | ||
diff(a, b); | ||
/* | ||
@@ -78,1 +79,3 @@ { | ||
[src.agency](http://src.agency) / Thomas Jensen | ||
[npm-image]: https://img.shields.io/npm/v/object-diff.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/object-diff |
Sorry, the diff of this file is not supported yet
77
2543
3
4
23