(cb)
| 6993 | const self = this; |
| 6994 | |
| 6995 | async function doBulkGet(cb) { |
| 6996 | const params = {}; |
| 6997 | if (opts.revs) { |
| 6998 | params.revs = true; |
| 6999 | } |
| 7000 | if (opts.attachments) { |
| 7001 | /* istanbul ignore next */ |
| 7002 | params.attachments = true; |
| 7003 | } |
| 7004 | if (opts.latest) { |
| 7005 | params.latest = true; |
| 7006 | } |
| 7007 | try { |
| 7008 | const result = await fetchJSON(genDBUrl(host, '_bulk_get' + paramsToStr(params)), { |
| 7009 | method: 'POST', |
| 7010 | body: JSON.stringify({ docs: opts.docs}) |
| 7011 | }); |
| 7012 | |
| 7013 | if (opts.attachments && opts.binary) { |
| 7014 | result.data.results.forEach(function (res$$1) { |
| 7015 | res$$1.docs.forEach(readAttachmentsAsBlobOrBuffer); |
| 7016 | }); |
| 7017 | } |
| 7018 | cb(null, result.data); |
| 7019 | } catch (error) { |
| 7020 | cb(error); |
| 7021 | } |
| 7022 | } |
| 7023 | |
| 7024 | /* istanbul ignore next */ |
| 7025 | function doBulkGetShim() { |
no test coverage detected
searching dependent graphs…