Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(build): build errors after changing meta data type
Elian Doran4e876ed24dd1
diff --git a/src/services/export/zip.ts b/src/services/export/zip.tsindex f6ffb45d1d..a21572b044 100644--- a/src/services/export/zip.ts+++ b/src/services/export/zip.ts@@ -407,6 +407,10 @@ ${markdownContent}`;}function saveNavigation(rootMeta: NoteMeta, navigationMeta: NoteMeta) {+ if (!navigationMeta.dataFileName) {+ return;+ }+function saveNavigationInner(meta: NoteMeta) {let html = "<li>";@@ -451,6 +455,10 @@ ${markdownContent}`;let firstNonEmptyNote;let curMeta = rootMeta;+ if (!indexMeta.dataFileName) {+ return;+ }+while (!firstNonEmptyNote) {if (curMeta.dataFileName && curMeta.noteId) {firstNonEmptyNote = getNoteTargetUrl(curMeta.noteId, rootMeta);@@ -479,6 +487,10 @@ ${markdownContent}`;}function saveCss(rootMeta: NoteMeta, cssMeta: NoteMeta) {+ if (!cssMeta.dataFileName) {+ return;+ }+const cssContent = fs.readFileSync(`${RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`);archive.append(cssContent, { name: cssMeta.dataFileName });diff --git a/src/services/utils.spec.ts b/src/services/utils.spec.tsindex 3451a881d3..a509b2b0af 100644--- a/src/services/utils.spec.ts+++ b/src/services/utils.spec.ts@@ -167,12 +167,12 @@ describe("#getContentDisposition", () => {const defaultFallBackDisposition = `file; filename="file"; filename*=UTF-8''file`;const testCases: TestCase<typeof utils.getContentDisposition>[] = [[- "when passed filename is empty, it should fallback to default value 'file'",+ "when passed filename is empty, it should fallback to default value 'file'",[" "],defaultFallBackDisposition],[- "when passed filename '..' would cause sanitized filename to be empty, it should fallback to default value 'file'",+ "when passed filename '..' would cause sanitized filename to be empty, it should fallback to default value 'file'",[".."],defaultFallBackDisposition],@@ -304,19 +304,16 @@ describe("#getNoteTitle", () => {],["when a noteMeta object is passed, it should use the title from the noteMeta, if present",- //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here["test_file.md", true, { title: "some other title"}],"some other title"],["when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed",- //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here["test_file.md", true, { title: ""}],"test file"],["when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed",- //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here["test_file.json", false, { title: " "}],"test_file.json"]@@ -627,4 +624,4 @@ describe("#formatDownloadTitle", () => {expect(actual).toStrictEqual(expected);});});-});\ No newline at end of file+});