Comparing version 1.1.1-beta to 1.2.0-beta
@@ -73,4 +73,6 @@ 'use strict' | ||
PouchDB.replicate = function (source, target, opts = {}, callback) { | ||
if (source._encrypted) source = source._encrypted | ||
if (target._encrypted) target = target._encrypted | ||
if (opts.comdb !== false) { | ||
if (source._encrypted) source = source._encrypted | ||
if (target._encrypted) target = target._encrypted | ||
} | ||
const promise = replicate(source, target, opts) | ||
@@ -77,0 +79,0 @@ return cbify(promise, callback) |
{ | ||
"name": "comdb", | ||
"version": "1.1.1-beta", | ||
"version": "1.2.0-beta", | ||
"description": "A PouchDB plugin that transparently encrypts and decrypts its data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -117,2 +117,9 @@ # ComDB | ||
You can also disable this functionality by passing `comdb: false` in the `opts` | ||
parameter: | ||
```javascript | ||
PouchDB.replicate(db1, db2, { comdb: false }) | ||
``` | ||
The instance methods `db.replicate.to` and `db.replicate.from` automatically use `PouchDB.replicate` so that wrapping the static method causes the instance methods to exhibit the same behavior. | ||
@@ -119,0 +126,0 @@ |
@@ -106,2 +106,17 @@ /* global describe, it, before, after */ | ||
}) | ||
it('should perform normal replication ok', async function () { | ||
return this.db.replicate.to(this.db2, { comdb: false }).then(() => { | ||
const opts = { include_docs: true } | ||
return Promise.all([ | ||
this.db.allDocs(opts), | ||
this.db2.allDocs(opts) | ||
]).then(([results1, results2]) => { | ||
assert.strictEqual(results1.total_rows, results2.total_rows) | ||
const doc1 = results1.rows[0].doc | ||
const doc2 = results2.rows[0].doc | ||
assert(isEqual(doc1, doc2)) | ||
}) | ||
}) | ||
}) | ||
}) | ||
@@ -108,0 +123,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24954
444
195