mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 11:42:26 +08:00
chore(server/utils): improve types for getNoteTitle
This commit is contained in:
parent
b812e67794
commit
c15e46bf25
@ -9,7 +9,7 @@ import mimeTypes from "mime-types";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
import { dirname, join } from "path";
|
import { dirname, join } from "path";
|
||||||
//import type { NoteType } from "../rows.js";
|
import type NoteMeta from "./meta/note_meta.js";
|
||||||
|
|
||||||
const randtoken = generator({ source: "crypto" });
|
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) {
|
if (noteMeta?.title) {
|
||||||
return noteMeta.title;
|
return noteMeta.title;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user