* Sends text * @param {string} text * @param {string} id * @param {string} mimeType * @param {(txt: string) => string} processText
(text, id, mimeType, processText)
| 519 | * @param {(txt: string) => string} processText |
| 520 | */ |
| 521 | function sendText(text, id, mimeType, processText) { |
| 522 | webServer?.send(id, { |
| 523 | status: 200, |
| 524 | body: processText ? processText(text) : text, |
| 525 | headers: { |
| 526 | "Content-Type": mimeType || "text/html", |
| 527 | }, |
| 528 | }); |
| 529 | } |
| 530 | |
| 531 | /** |
| 532 | * Opens the preview in browser |
no test coverage detected