agoge-pouchdb-plugins
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -102,3 +102,3 @@ var CryptoJS = require('crypto-js'); | ||
exports.find = async function(type, key, value, include_docs) { | ||
exports.first = async function(type, key, value, include_docs) { | ||
var options = { | ||
@@ -223,18 +223,9 @@ key: [], | ||
var o = JSON.parse(JSON.stringify(doc)); | ||
o._id = o._id.replace('-', '@') + '.' + docRevNo; | ||
delete o._rev; | ||
delete o.id; | ||
delete o.type; | ||
await db.put(o); | ||
try { | ||
var old = await db.get(doc._id); | ||
} catch (err) { | ||
var old = { _attachments: {} }; | ||
} | ||
doc._attachments = old._attachments || {}; | ||
var an = 'revisions/' + docRevNo + '.json'; | ||
doc._attachments[an] = { | ||
"content_type": "application/json", | ||
data: new Buffer(currentVersionJson) | ||
} | ||
var ret = await this.put(doc); | ||
@@ -267,1 +258,2 @@ return ret; | ||
}; | ||
{ | ||
"name": "agoge-pouchdb-plugins", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "My personal plugin functions to pouchdb-couchdb", | ||
@@ -5,0 +5,0 @@ "main": "agoge-pouchdb-plugins.js", |
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
5866
190