objectDiff.js icon indicating copy to clipboard operation
objectDiff.js copied to clipboard

Description of the algorithm's behavior

Open fresheneesz opened this issue 10 years ago • 2 comments

It would be super helpful if you could describe the behavior of the algorithm in the docs. I'm not talking about explaining how it works, rather what kind of output it generates, and what kind of performance it has (where it shines and where it doesn't). Does it support generating 'move' and 'copy' typed changes? Does it attempt to minimize the number of changes in the patch at all?

Some explanation here would make it much easier to evaluate whether this module is appropriate in a given situation.

fresheneesz avatar Jul 03 '15 03:07 fresheneesz

Does it support generating 'move' and 'copy' typed changes?

No.

Does it attempt to minimize the number of changes in the patch at all?

No.

The algorithm is very naive as it was originally used to compare plain (non-array) objects.

diff([1, 3], [1, 2, 3]):

{
    0: 1,
-   1: 3,
+   1: 2,
+   2: 3
}

NV avatar Jul 03 '15 04:07 NV

I’m accepting pull requests.

NV avatar Jul 03 '15 04:07 NV