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

Function getDiffs

lib/index.es.js:9921–9943  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9919 }
9920
9921 function getDiffs() {
9922 var diff = {};
9923 currentBatch.changes.forEach(function (change) {
9924 returnValue.emit('checkpoint', { 'revs_diff': change });
9925 // Couchbase Sync Gateway emits these, but we can ignore them
9926 /* istanbul ignore if */
9927 if (change.id === "_user/") {
9928 return;
9929 }
9930 diff[change.id] = change.changes.map(function (x) {
9931 return x.rev;
9932 });
9933 });
9934 return target.revsDiff(diff).then(function (diffs) {
9935 /* istanbul ignore if */
9936 if (returnValue.cancelled) {
9937 completeReplication();
9938 throw new Error('cancelled');
9939 }
9940 // currentBatch.diffs elements are deleted as the documents are written
9941 currentBatch.diffs = diffs;
9942 });
9943 }
9944
9945 function getBatchDocs() {
9946 return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) {

Callers 1

startNextBatchFunction · 0.70

Calls 1

completeReplicationFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…