You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -239,7 +237,7 @@ Compares two arrays and returns a diff for each entry. Supports duplicate values
239
237
nextList: T[];
240
238
options?: {
241
239
showOnly?: ("added"|"deleted"|"moved"|"updated"|"equal")[], // [] by default
242
-
referenceProperty?: string, // "" by default
240
+
referenceKey?: string, // "" by default
243
241
ignoreArrayOrder?: boolean, // false by default,
244
242
considerMoveAsUpdate?: boolean// false by default
245
243
}
@@ -248,7 +246,7 @@ Compares two arrays and returns a diff for each entry. Supports duplicate values
248
246
-`nextList`: the new list.
249
247
-`options`
250
248
-`showOnly` gives you the option to return only the values whose status you are interested in (e.g. `["added", "equal"]`).
251
-
-`referenceProperty` will consider an object to be `updated` rather than `added` or `deleted` if one of its properties remains stable, such as its `id`. This option has no effect on other datatypes.
249
+
-`referenceKey` will consider an object to be `updated` rather than `added` or `deleted` if one of its properties remains stable, such as its `id`. This option has no effect on other datatypes.
252
250
-`ignoreArrayOrder`: if set to `true`, `["hello", "world"]` and `["world", "hello"]` will be treated as `equal`, because the two arrays contain the same values, just in a different order.
253
251
-`considerMoveAsUpdate`: if set to `true` a `moved` value will be considered as `updated`.
-`ignoreArrayOrder`: if set to `true`, `["hello", "world"]` and `["world", "hello"]` will be treated as `equal`, because the two arrays contain the same values, just in a different order.
543
-
544
-
#### USAGE
545
-
546
-
547
-
```ts
548
-
isEqual(
549
-
[
550
-
{ name: "joe", age: 99 },
551
-
{ name: "nina", age: 23 },
552
-
],
553
-
[
554
-
{ name: "joe", age: 98 },
555
-
{ name: "nina", age: 23 },
556
-
],
557
-
);
558
-
```
559
-
560
-
**Output**
561
-
562
-
```ts
563
-
false;
564
-
```
565
-
<hr/>
566
-
567
-
### isObject
568
-
569
-
```js
570
-
import { isObject } from"@donedeal0/superdiff";
571
-
```
572
-
573
-
Tests whether a value is an object.
574
-
575
-
#### FORMAT
576
-
577
-
**Input**
578
-
579
-
```ts
580
-
value: unknown;
581
-
```
582
-
583
-
-`value`: the value whose type will be checked.
584
-
585
-
#### USAGE
586
-
587
-
**Input**
588
-
589
-
```ts
590
-
isObject(["hello", "world"]);
591
-
```
592
-
593
-
**Output**
594
-
595
-
```ts
596
-
false;
597
-
```
598
-
599
-
<hr/>
600
-
601
508
### ℹ️ More examples are available in the source code tests.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@donedeal0/superdiff",
3
-
"version": "3.2.0",
3
+
"version": "4.0.0",
4
4
"type": "module",
5
5
"description": "Superdiff provides a rich and readable diff for both arrays and objects. It supports stream and file inputs for handling large datasets efficiently, is battle-tested, has zero dependencies, and offer a top-tier performance.",
0 commit comments