server-ts: Port services/import/zip

This commit is contained in:
Elian Doran
2024-04-03 22:46:14 +03:00
parent 764d251b0a
commit 53d4873c1f
7 changed files with 136 additions and 158 deletions

View File

@@ -226,8 +226,8 @@ function removeTextFileExtension(filePath: string) {
}
}
function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boolean, noteMeta?: { title: string }) {
if (noteMeta) {
function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boolean, noteMeta?: { title?: string }) {
if (noteMeta?.title) {
return noteMeta.title;
} else {
const basename = path.basename(removeTextFileExtension(filePath));