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

Function replicateWrapper

lib/index-browser.js:10323–10348  ·  view source on GitHub ↗
(src, target, opts, callback)

Source from the content-addressed store, hash-verified

10321}
10322
10323function replicateWrapper(src, target, opts, callback) {
10324
10325 if (typeof opts === 'function') {
10326 callback = opts;
10327 opts = {};
10328 }
10329 if (typeof opts === 'undefined') {
10330 opts = {};
10331 }
10332
10333 if (opts.doc_ids && !Array.isArray(opts.doc_ids)) {
10334 throw createError(BAD_REQUEST,
10335 "`doc_ids` filter parameter is not a list.");
10336 }
10337
10338 opts.complete = callback;
10339 opts = clone(opts);
10340 opts.continuous = opts.continuous || opts.live;
10341 opts.retry = ('retry' in opts) ? opts.retry : false;
10342 opts.PouchConstructor = opts.PouchConstructor || this;
10343 var replicateRet = new Replication(opts);
10344 var srcPouch = toPouch(src, opts);
10345 var targetPouch = toPouch(target, opts);
10346 replicate(srcPouch, targetPouch, opts, replicateRet);
10347 return replicateRet;
10348}
10349
10350function sync(src, target, opts, callback) {
10351 if (typeof opts === 'function') {

Callers 1

constructorMethod · 0.70

Calls 4

createErrorFunction · 0.70
cloneFunction · 0.70
toPouchFunction · 0.70
replicateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…