mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 10:39:00 +01:00
chore(export/share): address review
This commit is contained in:
parent
bb636128b0
commit
357d294f2d
@ -27,14 +27,14 @@ import { NoteType } from "@triliumnext/commons";
|
|||||||
|
|
||||||
async function exportToZip(taskContext: TaskContext<"export">, branch: BBranch, format: ExportFormat, res: Response | fs.WriteStream, setHeaders = true, zipExportOptions?: AdvancedExportOptions) {
|
async function exportToZip(taskContext: TaskContext<"export">, branch: BBranch, format: ExportFormat, res: Response | fs.WriteStream, setHeaders = true, zipExportOptions?: AdvancedExportOptions) {
|
||||||
if (!["html", "markdown", "share"].includes(format)) {
|
if (!["html", "markdown", "share"].includes(format)) {
|
||||||
throw new ValidationError(`Only 'html' and 'markdown' allowed as export format, '${format}' given`);
|
throw new ValidationError(`Only 'html', 'markdown' and 'share' allowed as export format, '${format}' given`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const archive = archiver("zip", {
|
const archive = archiver("zip", {
|
||||||
zlib: { level: 9 } // Sets the compression level.
|
zlib: { level: 9 } // Sets the compression level.
|
||||||
});
|
});
|
||||||
const rewriteFn = (zipExportOptions?.customRewriteLinks ? zipExportOptions?.customRewriteLinks(rewriteLinks, getNoteTargetUrl) : rewriteLinks);
|
const rewriteFn = (zipExportOptions?.customRewriteLinks ? zipExportOptions?.customRewriteLinks(rewriteLinks, getNoteTargetUrl) : rewriteLinks);
|
||||||
const provider= buildProvider();
|
const provider = buildProvider();
|
||||||
|
|
||||||
const noteIdToMeta: Record<string, NoteMeta> = {};
|
const noteIdToMeta: Record<string, NoteMeta> = {};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user