Following on from #78 , createPatch should have Date handling added so that JS objects with a Date object inside are handled correctly.
Currently they are effectively ignored.
const userA = { createdAt: new Date(2010, 7, 10, 22, 10, 48) };
const userB = { createdAt: new Date(2011, 7, 10, 22, 10, 48) };
const patch = createPatch(userA, userB);
// []
This is because in the current handling of diff, Date objects get read as an object type and so it attempts to iterate over its keys of which there are none, resulting in an empty patch despite the value being different.
Following on from #78 ,
createPatchshould have Date handling added so that JS objects with a Date object inside are handled correctly.Currently they are effectively ignored.
This is because in the current handling of diff, Date objects get read as an
objecttype and so it attempts to iterate over its keys of which there are none, resulting in an empty patch despite the value being different.