json-diff icon indicating copy to clipboard operation
json-diff copied to clipboard

Long arrays that do not change are showing as changed

Open aleclandow opened this issue 1 year ago • 0 comments

diff(
      [
        ['A', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
        ['B', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
      ],
      [
        ['A', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
        ['B', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
      ]
)

yields an output of

[
    [
        "+",
        ["A", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
    ],
    [
        "~",
        [
            ["-", "A"],  [ "+", "B" ], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "]
        ]
    ],
    [
        "-",
         ["B", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
    ]
]

The output shows no change if the array has length 12 or fewer.

aleclandow avatar Feb 23 '24 20:02 aleclandow