As it turned out, I didn't even need pouchdb-extend for cloning, because the tests can pass without any cloning, which is a win for performance.
I also decided to formalize how I think the _rev/_id system ought to work:
a {} object gets passed in to the diffFunc the first time (as described in the README now, thanks @slang800)
_rev/_id gets passed in after that
I think this is the most logical, given that you're seeing the object exactly as it was get()ted from the database (except in the case of {}, which is a little odd but still acceptable IMO).
My proposed version of https://github.com/pouchdb/pouchdb-upsert/pull/3.
As it turned out, I didn't even need
pouchdb-extend
for cloning, because the tests can pass without any cloning, which is a win for performance.I also decided to formalize how I think the
_rev
/_id
system ought to work:{}
object gets passed in to thediffFunc
the first time (as described in the README now, thanks @slang800)_rev
/_id
gets passed in after thatI think this is the most logical, given that you're seeing the object exactly as it was
get()
ted from the database (except in the case of{}
, which is a little odd but still acceptable IMO).