added utilities to make and recover snapshots

This commit is contained in:
Kevin Jahns
2019-01-29 00:54:58 +01:00
parent 77e479c03b
commit 3a0694c35c
23 changed files with 337 additions and 109 deletions

View File

@@ -92,7 +92,6 @@ export class DeleteStore extends Tree {
}
}
/**
* Stringifies a message-encoded Delete Set.
*

View File

@@ -1,8 +1,7 @@
/**
*
*
* @param {Item} item
* @param {import("../protocols/history").HistorySnapshot} [snapshot]
*/
export const isVisible = (item, snapshot) => snapshot === undefined ? !item._deleted : (snapshot.sm.has(item._id.user) && snapshot.sm.get(item._id.user) > item._id.clock && !snapshot.ds.isDeleted(item._id))
export const isVisible = (item, snapshot) => snapshot === undefined ? !item._deleted : (snapshot.sm.has(item._id.user) && snapshot.sm.get(item._id.user) > item._id.clock && !snapshot.ds.isDeleted(item._id))