(filePath, data)
| 17 | } |
| 18 | |
| 19 | export async function appendToFile(filePath, data) { |
| 20 | if (!data) return; |
| 21 | const enteries = filePath.split("/"); |
| 22 | const fileName = enteries.pop(); |
| 23 | const utf8Buffer = encode(data); |
| 24 | |
| 25 | try { |
| 26 | await filePath.write(utf8Buffer); |
| 27 | await filePath.close(); |
| 28 | } catch (error) { |
| 29 | toast(error); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /**@param {string} attachmentUrl*/ |
| 34 | export async function writeAttachmentFile(attachmentUrl, filePath) { |
no test coverage detected