@ -6,7 +6,7 @@ This library compares two arrays or objects and return a complete diff of their
## WHY YOU SHOULD USE THIS LIB
## WHY YOU SHOULD USE THIS LIB
All other existing solutions return a weird diff format which often require an additionnal parsing. They are also limited to object comparison. Some even have CPU spikes issues. 👎
All other existing solutions return a weird diff format which often require an additionnal parsing. They are also limited to object comparison. 👎
**Superdiff** gives you a complete diff for both array <u>and</u> objects with a very readable format. Last but not least, it's battled tested. Import. Enjoy. 👍
**Superdiff** gives you a complete diff for both array <u>and</u> objects with a very readable format. Last but not least, it's battled tested. Import. Enjoy. 👍
@ -38,8 +38,6 @@ const objectB = {
}
}
```
```
**Deep-Diff**
**Deep-Diff** output:
**Deep-Diff** output:
```js
```js
@ -58,7 +56,7 @@ const objectB = {
}
}
]
]
````
```
**SuperDiff** output:
**SuperDiff** output:
@ -125,10 +123,14 @@ const objectB = {
### getObjectDiff()
### getObjectDiff()
compare two objects and return a diff for each value and their potential subvalues:
```js
import { getObjectDiff } from "superdiff";
```
Compares two objects and return a diff for each value and their potential subvalues:
- property name
- property name
- status: added, deleted, equal, updated
- status: `added`, `deleted`, `equal`, `updated`
- previous value, current value
- previous value, current value
- supports deeply nested objects with any kind of values
- supports deeply nested objects with any kind of values