Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
});
}
return new Promise(function (resolve) {
blufferToBase64(blob, resolve);
});
}).then(function (data) {
return new Promise(function (resolve) {
blufferToBase64(attachment.data, resolve);
}).then(function (b64) {
attachment.data = b64;
resolveB64Data = new Promise((resolve, reject) => {
blobOrBufferToBase64(attachment.data, b64 => resolve(b64))
}).catch(() =>
Promise.reject(