wechaty-puppet-official-account
Version:
Wechaty Puppet for WeChat Official Accounts
18 lines • 592 B
JavaScript
import { FileBoxType, } from 'file-box';
import { log, } from 'wechaty-puppet';
const normalizeFileBox = async (fileBox) => {
log.verbose('WechatyPluginFreshdesk', 'normalizeFileBox({type: "%s", name: "%s"})', FileBoxType[fileBox.type], fileBox.name);
const buf = await fileBox.toBuffer();
const length = buf.byteLength;
const info = {
contentType: fileBox.mediaType,
filename: fileBox.name.trim(),
knownLength: length,
};
return {
buf,
info,
};
};
export { normalizeFileBox };
//# sourceMappingURL=normalize-file-box.js.map