dartx
dartx copied to clipboard
equals extension for deep equality of iterables
Please add equals extensions based on ListEquality and so on...
~It is not possible to create an extension named equals because every object already has a method with that name.~ There already exists the .contentEquals() extension for iterables (and lists).
I like the idea but I'm unsure if we should use ListEquality or DeepCollectionEquality. Please describe your use case and we can see which API fits best.
Alternatively you could use collections which support equality by default: BuildList or KtList
You probably mean == operator, I didn't see a equals in Iterable, List, etc. .contentEquals() is ok.
You probably mean == operator
Yes, my bad. Is the contentEquals() method not suggested for auto-completion if you type "equals"?
To be honest I am against about to use different collections. I prefer use core lib with extensions =)
Does contentEquals() solve your problem or do you need more options / deep collection equality?
Well, contentEquals solved my problem, but I think will be nice to have deep collection equality as well.