MCPcopy Index your code
hub / github.com/apache/pouchdb / preprocessBlob

Function preprocessBlob

lib/index-browser.js:4430–4449  ·  view source on GitHub ↗
(att, blobType, callback)

Source from the content-addressed store, hash-verified

4428}
4429
4430function preprocessBlob(att, blobType, callback) {
4431 binaryMd5(att.data, function (md5) {
4432 att.digest = 'md5-' + md5;
4433 // size is for blobs (browser), length is for buffers (node)
4434 att.length = att.data.size || att.data.length || 0;
4435 if (blobType === 'binary') {
4436 blobToBinaryString(att.data, function (binString) {
4437 att.data = binString;
4438 callback();
4439 });
4440 } else if (blobType === 'base64') {
4441 blobToBase64(att.data, function (b64) {
4442 att.data = b64;
4443 callback();
4444 });
4445 } else {
4446 callback();
4447 }
4448 });
4449}
4450
4451function preprocessAttachment(att, blobType, callback) {
4452 if (att.stub) {

Callers 1

preprocessAttachmentFunction · 0.70

Calls 3

binaryMd5Function · 0.70
blobToBinaryStringFunction · 0.70
blobToBase64Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…