mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-29 11:00:12 +00:00
more doc tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
63e8375926
commit
829d2c31d9
17
README.md
17
README.md
@ -71,10 +71,7 @@ var diff = Diff(Bill, Ted)
|
|||||||
Here's how different `Bill` and `Ted` really are (or how the *diff* looks like):
|
Here's how different `Bill` and `Ted` really are (or how the *diff* looks like):
|
||||||
```javascript
|
```javascript
|
||||||
// log out the relevant part...
|
// log out the relevant part...
|
||||||
JSON.stringify(diff.diff, null, '\t')
|
//JSON.stringify(diff.diff, null, '\t')
|
||||||
```
|
|
||||||
And the output is:
|
|
||||||
```json
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"path": ["name"],
|
"path": ["name"],
|
||||||
@ -125,12 +122,10 @@ diff.patch(Bill2)
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Since we applied all the changes to `Bill2`, now he looks just like `Ted`:
|
Since we applied *all* the changes to `Bill2`, now he looks just like `Ted`:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
JSON.stringify(Bill2, null, '\t')
|
//JSON.stringify(Bill2, null, '\t')
|
||||||
```
|
|
||||||
```json
|
|
||||||
{
|
{
|
||||||
"name": "Ted",
|
"name": "Ted",
|
||||||
"age": 20,
|
"age": 20,
|
||||||
@ -145,7 +140,7 @@ JSON.stringify(Bill2, null, '\t')
|
|||||||
|
|
||||||
### Partial patching
|
### Partial patching
|
||||||
|
|
||||||
Lets just *patch* `Bill`'s the skill level...
|
Lets just *patch* `Bill`'s skill level...
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
diff
|
diff
|
||||||
@ -157,9 +152,7 @@ diff
|
|||||||
Now, `Bill` can also play guitar!
|
Now, `Bill` can also play guitar!
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
JSON.stringify(Bill, null, '\t')
|
//JSON.stringify(Bill, null, '\t')
|
||||||
```
|
|
||||||
```json
|
|
||||||
{
|
{
|
||||||
"name": "Bill",
|
"name": "Bill",
|
||||||
"age": 20,
|
"age": 20,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user