Closed SvenWerlen closed 4 years ago
Can you please give me more of an overview of this change. You say that you're highlighting children when a parent is missing. What difference are you trying to show here? What about parents of parents? Can you come up with a simple case for this so we could add a unit test?
When an element is missing (left or right), its children should also be considered missing and be highlighted. You can see it in your samples. "Alexander Skarsguard" is missing on the right, so "Generation Kill" and "True Blood" are also missing and highlighted.
So let's say I have a JSON object on the left with a property named foo
and that property has 1,000 children. If the JSON on the right doesn't have the foo
property then would that mean I see 1,001 differences instead of one?
Yes, but I see the problem with that approach. In my case, I was more interested in highlighting those 1000 children and couldn't find a way to see it as 1 difference only.
I'm a little worried about turning 1 difference into 1,001 or more. This could result in too many differences to make sense of anything.
Sure, I understand. As I said, I reused your code only for the "highlight" so it's not a problem in my case. I'll close that pull request.
Thank you for understanding. I like the general idea of highlighting diffs in new ways. If you come up with any other ideas please let me know.
Sure. Thanks.
Same as Highlight children when parent is missing but I fixed.