How to use the pouchdb-binary-utils.blobOrBufferToBase64 function in pouchdb-binary-utils

To help you get started, we’ve selected a few pouchdb-binary-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-utils / src / preprocessAttachments.js View on Github external
binaryMd5(att.data, function (md5) {
    att.digest = 'md5-' + md5;
    // size is for blobs (browser), length is for buffers (node)
    att.length = att.data.size || att.data.length || 0;
    if (blobType === 'binary') {
      blufferToBinaryString(att.data, function (binString) {
        att.data = binString;
        callback();
      });
    } else if (blobType === 'base64') {
      blufferToBase64(att.data, function (b64) {
        att.data = b64;
        callback();
      });
    } else {
      callback();
    }
  });
}
github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-http / src / index.js View on Github external
return new Promise(function (resolve) {
            blufferToBase64(blob, resolve);
          });
        }).then(function (data) {
github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-http / src / index.js View on Github external
return new Promise(function (resolve) {
        blufferToBase64(attachment.data, resolve);
      }).then(function (b64) {
        attachment.data = b64;
github stockulus / pouchdb-react-native / packages / pouchdb-adapter-asyncstorage / src / bulk_docs.js View on Github external
resolveB64Data = new Promise((resolve, reject) => {
          blobOrBufferToBase64(attachment.data, b64 => resolve(b64))
        }).catch(() =>
          Promise.reject(