refactor(services): use named imports from utils

This commit is contained in:
Panagiotis Papadopoulos
2025-01-02 13:47:44 +01:00
parent 3814621e1c
commit 7fe23c7ac2
34 changed files with 122 additions and 122 deletions

View File

@@ -2,7 +2,7 @@
import mimeTypes from "mime-types";
import html from "html";
import utils from "../utils.js";
import { getContentDisposition, escapeHtml } from "../utils.js";
import mdService from "./md.js";
import becca from "../../becca/becca.js";
import TaskContext from "../task_context.js";
@@ -61,7 +61,7 @@ function exportSingleNote(taskContext: TaskContext, branch: BBranch, format: "ht
const fileName = `${note.title}.${extension}`;
res.setHeader('Content-Disposition', utils.getContentDisposition(fileName));
res.setHeader('Content-Disposition', getContentDisposition(fileName));
res.setHeader('Content-Type', `${mime}; charset=UTF-8`);
res.send(payload);
@@ -119,7 +119,7 @@ function inlineAttachments(content: string) {
const base64Content = attachmentContent.toString('base64');
const hrefValue = `data:${attachment.mime};base64,${base64Content}`;
return `href="${hrefValue}" download="${utils.escapeHtml(attachment.title)}"`;
return `href="${hrefValue}" download="${escapeHtml(attachment.title)}"`;
});
return content;