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

Function replicateWrapper

lib/index.es.js:10352–10377  ·  view source on GitHub ↗
(src, target, opts, callback)

Source from the content-addressed store, hash-verified

10350}
10351
10352function replicateWrapper(src, target, opts, callback) {
10353
10354 if (typeof opts === 'function') {
10355 callback = opts;
10356 opts = {};
10357 }
10358 if (typeof opts === 'undefined') {
10359 opts = {};
10360 }
10361
10362 if (opts.doc_ids && !Array.isArray(opts.doc_ids)) {
10363 throw createError(BAD_REQUEST,
10364 "`doc_ids` filter parameter is not a list.");
10365 }
10366
10367 opts.complete = callback;
10368 opts = clone(opts);
10369 opts.continuous = opts.continuous || opts.live;
10370 opts.retry = ('retry' in opts) ? opts.retry : false;
10371 opts.PouchConstructor = opts.PouchConstructor || this;
10372 var replicateRet = new Replication(opts);
10373 var srcPouch = toPouch(src, opts);
10374 var targetPouch = toPouch(target, opts);
10375 replicate(srcPouch, targetPouch, opts, replicateRet);
10376 return replicateRet;
10377}
10378
10379function sync(src, target, opts, callback) {
10380 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…