Skip to content

Commit fce4043

Browse files
committed
Added article link and edited parts of README
1 parent f316317 commit fce4043

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
Microdiff is a tiny (currently <1kb), fast, zero dependency object and array comparison library. It is significantly faster than most other deep comparison libraries, and has full TypeScript support.
66

7+
8+
> 💡 I recommend reading this blog post:
9+
>
10+
> **[Building the fastest object and array differ](https://byteofdev.com/posts/microdiff/)** for an explanation of how Microdiff achieves its size and speed.
11+
712
![Minizipped Size (from Bundlephobia)](https://img.shields.io/bundlephobia/minzip/microdiff?style=flat-square) ![License](https://img.shields.io/npm/l/microdiff?style=flat-square) ![dependency Count](https://img.shields.io/badge/dependencies-0-green?style=flat-square)
813

914
</div>
@@ -12,7 +17,7 @@ Microdiff is a tiny (currently <1kb), fast, zero dependency object and array com
1217

1318
- 🚀 More than double the speed of other object diff libraries
1419
- 📦 Extremely lightweight, <1kb minified
15-
- 🌎 Supports Deno, Node, the web, and even service workers. Also comes with built in Typescript types
20+
- 🌎 Supports Deno, Node, the web, and even service workers. Also comes with built-in Typescript types
1621
- 🔰 Very easy to use, having just a single `diff()` function
1722
- 📅 Full support for objects like `new Date()` and `new RegExp()`
1823

@@ -26,7 +31,7 @@ npm i microdiff
2631

2732
If you are using Deno, you can import it from Deno.land with the link `https://deno.land/x/microdiff@VERSION/index.ts` (remember to change `@VERSION` to the version you want to use).
2833

29-
After you install it, simply import it and run it on two objects.
34+
After you install it, import it and run it on two objects.
3035

3136
```js
3237
import diff from "microdiff";
@@ -49,15 +54,15 @@ If you are using CommonJS, you can import it like this:
4954
const diff = require("microdiff").default;
5055
```
5156

52-
There are three different types of changes. `CREATE`, `REMOVE`, and `CHANGE`.
57+
There are three different types of changes: `CREATE`, `REMOVE`, and `CHANGE`.
5358
The `path` property gives a path to the property in the new object (or the old object in the case of `REMOVE`).
54-
Each element in the paths is a key to the next property a level deeper until you get to the property changed, and it is string or a number, depending on whether the object is an Array or Object (Objects with number keys will still be strings).
59+
Each element in the paths is a key to the next property a level deeper until you get to the property changed, and it is a string or a number, depending on whether the object is an Array or Object (Objects with number keys will still be strings).
5560
The `value` property exists in types `CREATE` and `CHANGE`, and it contains the value of the property added/changed/deleted.
5661
The `oldValue` property exists in the type `CHANGE` and `REMOVE`, and it contains the old value of the property.
5762

5863
# Cycles support
5964

60-
By default cycles are supported, but if you are sure that the object has no cycles (for example if you are parsing JSON) you can disable cycles using the `cyclesFix` option.
65+
By default, Microdiff supports cyclical references, but if you are sure that the object has no cycles like parsed JSON, you can disable cycles using the `cyclesFix` option.
6166

6267
```js
6368
diff(obj1, obj2, { cyclesFix: false });

0 commit comments

Comments
 (0)