MCPcopy Index your code
hub / github.com/apache/pouchdb / preprocessAttachments$1

Function preprocessAttachments$1

lib/index.js:6721–6736  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

6719}
6720
6721function preprocessAttachments$1(doc) {
6722 if (!doc._attachments || !Object.keys(doc._attachments)) {
6723 return Promise.resolve();
6724 }
6725
6726 return Promise.all(Object.keys(doc._attachments).map(function (key) {
6727 const attachment = doc._attachments[key];
6728 if (attachment.data && typeof attachment.data !== 'string') {
6729 return new Promise(function (resolve) {
6730 blobToBase64(attachment.data, resolve);
6731 }).then(function (b64) {
6732 attachment.data = b64;
6733 });
6734 }
6735 }));
6736}
6737
6738function hasUrlPrefix(opts) {
6739 if (!opts.prefix) {

Callers 1

HttpPouchFunction · 0.70

Calls 1

blobToBase64Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…