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

Function preprocessString

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

Source from the content-addressed store, hash-verified

4408}
4409
4410function preprocessString(att, blobType, callback) {
4411 var asBinary = parseBase64(att.data);
4412 if (asBinary.error) {
4413 return callback(asBinary.error);
4414 }
4415
4416 att.length = asBinary.length;
4417 if (blobType === 'blob') {
4418 att.data = binStringToBluffer(asBinary, att.content_type);
4419 } else if (blobType === 'base64') {
4420 att.data = thisBtoa(asBinary);
4421 } else { // binary
4422 att.data = asBinary;
4423 }
4424 binaryMd5(asBinary, function (result) {
4425 att.digest = 'md5-' + result;
4426 callback();
4427 });
4428}
4429
4430function preprocessBlob(att, blobType, callback) {
4431 binaryMd5(att.data, function (md5) {

Callers 1

preprocessAttachmentFunction · 0.70

Calls 4

parseBase64Function · 0.70
binStringToBlufferFunction · 0.70
thisBtoaFunction · 0.70
binaryMd5Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…