Open
Description
This question was asked before at #91 but the only proposed answer was to modify the library.
I believe making this library optionally support immutable reference equality would be easy if the prefilter
function also passed the lhs
and rhs
values to the prefilter. This would allow us to opt-in to reference equality using
function prefilterImmutable(path, key, lhs, rhs) {
return lhs === rhs
}
diff(foo, bar, prefilterImmutable)
This allows skipping reference equality without having to modify the library's core function. The existing prefilter option is taken advantage of, and also is expanded on to allow other types of prefilters relying on the value of the thing being filtered (for example, possibly against objects signifying equality using ID properties).
Metadata
Metadata
Assignees
Labels
No labels