agoge-pouchdb-plugins
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -35,7 +35,8 @@ var CryptoJS = require('crypto-js'); | ||
exports.tolist = async function(ddoc, view, include_docs) { | ||
var options = {}; | ||
exports.tolist = async function(ddoc, view, options) { | ||
var options = options || {}; | ||
var view = view || ddoc; | ||
options["include_docs"] = include_docs; | ||
if ( options["include_docs"] !== false) | ||
options["include_docs"] = true; | ||
@@ -53,6 +54,8 @@ var queryResults = await this.query(ddoc + '/' + view, options); | ||
exports.scalar = async function(ddoc, view) { | ||
var options = {}; | ||
exports.scalar = async function(ddoc, view, options) { | ||
var options = options || {}; | ||
options["include_docs"] = true; | ||
if ( options["include_docs"] !== false) | ||
options["include_docs"] = true; | ||
options["limit"] = 1; | ||
@@ -79,2 +82,4 @@ | ||
}; | ||
options.include_docs = include_docs; | ||
@@ -84,3 +89,2 @@ if (type) options.key.push(type); | ||
if (value) options.key.push(value); | ||
@@ -109,5 +113,5 @@ await this.upsert({ | ||
if (all) | ||
return await this.tolist('find', 'find', include_docs); | ||
return await this.tolist('find', 'find', options); | ||
else | ||
return await this.scalar('find', 'find'); | ||
return await this.scalar('find', 'find', options); | ||
@@ -114,0 +118,0 @@ } |
{ | ||
"name": "agoge-pouchdb-plugins", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"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
4980
155