Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
api._allDocs = function (opts, callback) {
if ('keys' in opts) {
return allDocsKeysQuery(this, opts);
}
return readLock(function (opts, callback) {
opts = clone(opts);
countDocs(function (err, docCount) {
/* istanbul ignore if */
if (err) {
return callback(err);
}
var readstreamOpts = {};
var skip = opts.skip || 0;
if (opts.startkey) {
readstreamOpts.gte = opts.startkey;
}
if (opts.endkey) {
readstreamOpts.lte = opts.endkey;
}