Fix the preserve array function with array of objects#44
Fix the preserve array function with array of objects#44popojargo wants to merge 1 commit intomattphillips:mainfrom
Conversation
|
@mattphillips Can you take a look a this? |
|
Hi, user here. Drivebying with a lightning review. Things that made me think:
Hopefully this is helpful 🏃♂️ |
Basically, I'm using CouchDB has a database. When updating a document, I need to do a For this reason, I use preserve-array.js which keeps the array and produce a real "array difference". So let's say I had originally this document: {
"children": [{"name":1}]
}and I end up with this document: {
"children": [{"name":1},{"name":2}]
}I would like the following diff to apply to the latest document:
|
|
Speaking of which -- why is preserve-array in the repo when it appears unused? And it's also undocumented. |
Your examples with works fine execpt when the values compared in the array are objects.
For example. this will work fine:
But, if you use a similar representation with objects, it fails: