0๐
โ
I was able to get every scenario working using the following customizer function along with mergeWith
:
mergeWith({}, destination, source, customizer);
const customizer = (objValue, srcValue, key) => {
if (key === "addresses") {
let merged = merge(
keyBy(objValue, "addressType"),
keyBy(srcValue, "addressType")
);
let value = values(merged);
return value;
}
};
Source:stackexchange.com