Skip to content

Build your personal knowledge base with Trilium Notes

server-ts: Port services/import/utils

Elian Doran052a0a44f2fb
diff --git a/src/services/import/utils.js b/src/services/import/utils.ts
similarity index 82%
rename from src/services/import/utils.js
rename to src/services/import/utils.ts
index 7b470852f3..8b06f21677 100644
--- a/src/services/import/utils.js
+++ b/src/services/import/utils.ts
@@ -1,6 +1,6 @@
"use strict";
-function handleH1(content, title) {
+function handleH1(content: string, title: string) {
content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {
if (title.trim() === text.trim()) {
return ""; // remove whole H1 tag
@@ -11,6 +11,6 @@ function handleH1(content, title) {
return content;
}
-module.exports = {
+export = {
handleH1
};