MCPcopy Index your code
hub / github.com/apache/pouchdb / rev

Function rev

lib/index.js:788–796  ·  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

786 * For example '56649f1b0506c6ca9fda0746eb0cacdf'
787 */
788function rev(doc, deterministic_revs) {
789 if (!deterministic_revs) {
790 return uuid.v4().replace(/-/g, '').toLowerCase();
791 }
792
793 var mutateableDoc = Object.assign({}, doc);
794 delete mutateableDoc._rev_tree;
795 return stringMd5(JSON.stringify(mutateableDoc));
796}
797
798var uuid$1 = uuid.v4; // mimic old import, only v4 is ever used elsewhere
799

Callers 2

parseDocFunction · 0.70

Calls 1

stringMd5Function · 0.70

Tested by

no test coverage detected