Comparing version 1.1.0-beta to 1.1.1-beta
11
index.js
@@ -31,3 +31,3 @@ 'use strict' | ||
try { | ||
const doc = decrypted.get(newDoc._id) | ||
const doc = await decrypted.get(newDoc._id) | ||
change = isEqual(newDoc, doc) ? undefined : newDoc | ||
@@ -60,3 +60,3 @@ } catch (err) { | ||
const encryptedDoc = { payload } | ||
const latestChanges = await encrypted.changes({ limit: 1, doc_ids: [id] }) | ||
const latestChanges = await encrypted.changes({ limit: 1, include_docs: true }) | ||
if (latestChanges.results && latestChanges.results.length) { | ||
@@ -123,8 +123,3 @@ const latestChange = latestChanges.results[0].doc | ||
const results = await bulkDocs.call(this, docs, opts) | ||
const ids = results | ||
.map(({ id }) => { return id }) | ||
.filter((id) => { | ||
const d = ((docs && docs.docs) || docs) | ||
return !d.map(({ _id }) => { return _id }).includes(id) | ||
}) | ||
const ids = results.map(({ id }) => { return id }) | ||
await processChange(ids) | ||
@@ -131,0 +126,0 @@ const promise = Promise.resolve(results) |
{ | ||
"name": "comdb", | ||
"version": "1.1.0-beta", | ||
"version": "1.1.1-beta", | ||
"description": "A PouchDB plugin that transparently encrypts and decrypts its data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,3 +25,2 @@ /* global describe, it, before, after */ | ||
it('should encrypt writes', async function () { | ||
this.timeout(4 * 1000) // sometimes runs long | ||
const { id } = await this.db.post({ hello: 'world' }) | ||
@@ -28,0 +27,0 @@ const doc = await this.db.get(id) |
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
24205
428