MCPcopy Create free account
hub / github.com/apache/pouchdb / replicateWrapper

Function replicateWrapper

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

Source from the content-addressed store, hash-verified

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