(body, type, asBlob, callback)
| 4770 | // and translating from base64 if the IDB doesn't support |
| 4771 | // native Blobs |
| 4772 | function readBlobData(body, type, asBlob, callback) { |
| 4773 | if (asBlob) { |
| 4774 | if (!body) { |
| 4775 | callback(createBlob([''], {type})); |
| 4776 | } else if (typeof body !== 'string') { // we have blob support |
| 4777 | callback(body); |
| 4778 | } else { // no blob support |
| 4779 | callback(b64ToBluffer(body, type)); |
| 4780 | } |
| 4781 | } else { // as base64 string |
| 4782 | if (!body) { |
| 4783 | callback(''); |
| 4784 | } else if (typeof body !== 'string') { // we have blob support |
| 4785 | readAsBinaryString(body, function (binary) { |
| 4786 | callback(thisBtoa(binary)); |
| 4787 | }); |
| 4788 | } else { // no blob support |
| 4789 | callback(body); |
| 4790 | } |
| 4791 | } |
| 4792 | } |
| 4793 | |
| 4794 | function fetchAttachmentsIfNecessary(doc, opts, txn, cb) { |
| 4795 | var attachments = Object.keys(doc._attachments || {}); |
no test coverage detected
searching dependent graphs…