code: function encodeMetadata(metadata, winningRev$$1, deleted) {
    return {
      data: pouchdbJson.safeJsonStringify(metadata),
      winningRev: winningRev$$1,
      deletedOrLocal: deleted ? '1' : '0',
      seq: metadata.seq, // highest seq for this doc
      id: metadata.id
    };
  }
docs: Unfortunately, the metadata has to be stringified when it is put into the database, because otherwise IndexedDB can throw errors for deeply-nested objects. Originally we just used JSON.parse/JSON.stringify; now we use this custom vuvuzela library that avoids recursion. If we could do it all over again, we'd probably use a format for the revision trees other than JSON.