UNPKG

wechaty-puppet-service

Version:
18 lines 579 B
import { FileBox, FileBoxType, } from 'file-box'; /** * @deprecated Will be removed after Dec 31, 2022 */ export const serializeFileBox = async (fileBox) => { const serializableFileBoxTypes = [ FileBoxType.Base64, FileBoxType.Url, FileBoxType.QRCode, ]; if (serializableFileBoxTypes.includes(fileBox.type)) { return JSON.stringify(fileBox); } const base64 = await fileBox.toBase64(); const name = fileBox.name; return JSON.stringify(FileBox.fromBase64(base64, name)); }; //# sourceMappingURL=serialize-file-box.js.map