({
take: [
{
key: "buffer",
type: "file",
label: "Document",
accept: ".doc,.docx,application/msword",
read: "buffer",
},
{
type: "import",
value: "https://cdn.jsdelivr.net/npm/mammoth@1.4.17/mammoth.browser.js",
},
],
make: async (arrayBuffer) => {
let value
if (arrayBuffer) {
value = (await mammoth.convertToHtml({ arrayBuffer })).value
return [{ type: "code", value }]
}
},
})