Skip to content

Commit 5e61620

Browse files
authored
fix: correct missing array keys in compare-by-key JSON comparison output (#53)
fix: correct missing array keys
1 parent 577e300 commit 5e61620

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/diff-array-compare-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function diffArrayRecursive(
120120
const rVal = rightItem[key];
121121
if (Array.isArray(lVal) && Array.isArray(rVal)) {
122122
// Recursively diff arrays
123-
const [arrL, arrR] = diffArrayRecursive(lVal, rVal, '', '', level + 2, options, [], []);
123+
const [arrL, arrR] = diffArrayRecursive(lVal, rVal, key, key, level + 2, options, [], []);
124124
linesLeft = concat(linesLeft, arrL);
125125
linesRight = concat(linesRight, arrR);
126126
} else if (Array.isArray(lVal) || Array.isArray(rVal)) {

0 commit comments

Comments
 (0)