UNPKG

wechaty-puppet-official-account

Version:
18 lines 592 B
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