gliese1337 / fast-myers-diff

MIT License
47 stars 8 forks source link

Add in custom comparator support for `diff` and the other functions #12

Closed jamesrwaugh closed 1 year ago

jamesrwaugh commented 3 years ago

Hi,

Thanks for this library. For my usecase I need a custom eq function for diff, but noticed it's only an option on diff_core. However, diff performs additional processing that's desirable for speed purposes.

Additionally, lcs and calcPatch cannot be used at all if the user has a custom diff requirement, if for example the arrays are not reference-comparable.

I have added an optional eq parameter to these and wrote a small test.

gliese1337 commented 1 year ago

Oh wow, sorry I didn't notice this for nearly 2 years! Yeah, this is a great change, thanks! Don't know why I didn't just do that myself in the first place...