New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

comdb

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comdb - npm Package Compare versions

Comparing version 5.0.1-beta to 5.0.2-beta

23

index.js

@@ -117,3 +117,24 @@ 'use strict'

const json = await this._crypt.decrypt(doc.payload)
return JSON.parse(json)
const decrypted = JSON.parse(json)
if ('_rev' in decrypted) {
return decrypted
} else {
// decrypted doc has no rev. there might already be one in the db
// so we have to check for it.
try {
const { _revisions: { ids } } = await this.get(decrypted._id, { revs: true })
decrypted._rev = `1-${ids[ids.length - 1]}`
} catch (err) {
if (err.name === 'not_found') {
// return the rev-less doc if no rev exists for it
return decrypted
} else {
throw err
}
}
// original doc lacks _rev, so apply it back now that we know it
doc.payload = await this._crypt.encrypt(JSON.stringify(decrypted))
await this._encrypted.put(doc)
return decrypted
}
} else {

@@ -120,0 +141,0 @@ if (!doc._id) doc._id = uuid()

8

package.json
{
"name": "comdb",
"version": "5.0.1-beta",
"version": "5.0.2-beta",
"description": "A PouchDB plugin that transparently encrypts and decrypts its data.",

@@ -42,3 +42,3 @@ "main": "index.js",

"tweetnacl-util": "^0.15.1",
"uuid": "^8.1.0"
"uuid": "^8.3.2"
},

@@ -54,6 +54,6 @@ "devDependencies": {

"nyc": "^15.1.0",
"pouchdb": "^7.2.2",
"standard": "^16.0.3",
"pouchdb": "^7.3.0",
"standard": "^17.0.0",
"uglify-js": "^3.13.5"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc