From c15e46bf2556fa44b0452bff48dd091e9713117a Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 31 Jan 2025 08:46:56 +0100 Subject: [PATCH] chore(server/utils): improve types for getNoteTitle --- src/services/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/utils.ts b/src/services/utils.ts index 174929334..a24698a1c 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -9,7 +9,7 @@ import mimeTypes from "mime-types"; import path from "path"; import { fileURLToPath } from "url"; import { dirname, join } from "path"; -//import type { NoteType } from "../rows.js"; +import type NoteMeta from "./meta/note_meta.js"; const randtoken = generator({ source: "crypto" }); @@ -181,7 +181,7 @@ export function removeTextFileExtension(filePath: string) { } } -export function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boolean, noteMeta?: { title?: string }) { +export function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boolean, noteMeta?: NoteMeta) { if (noteMeta?.title) { return noteMeta.title; } else {