MCPcopy
hub / github.com/apache/pouchdb / rev

Function rev

lib/index-browser.js:947–955  ·  view source on GitHub ↗

* Creates a new revision string that does NOT include the revision height * For example '56649f1b0506c6ca9fda0746eb0cacdf'

(doc, deterministic_revs)

Source from the content-addressed store, hash-verified

945 * For example '56649f1b0506c6ca9fda0746eb0cacdf'
946 */
947function rev(doc, deterministic_revs) {
948 if (!deterministic_revs) {
949 return uuid.v4().replace(/-/g, '').toLowerCase();
950 }
951
952 var mutateableDoc = Object.assign({}, doc);
953 delete mutateableDoc._rev_tree;
954 return stringMd5(JSON.stringify(mutateableDoc));
955}
956
957var uuid$1 = uuid.v4; // mimic old import, only v4 is ever used elsewhere
958

Callers 2

parseDocFunction · 0.70

Calls 1

stringMd5Function · 0.70

Tested by

no test coverage detected