mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
many small fixes from Intellij analysis
This commit is contained in:
@@ -65,7 +65,7 @@ function importCodeNote(taskContext, file, parentNote) {
|
||||
const detectedMime = mimeService.getMime(file.originalname) || file.mimetype;
|
||||
const mime = mimeService.normalizeMimeType(detectedMime);
|
||||
|
||||
const {note} = noteService.createNewNote({
|
||||
const { note } = noteService.createNewNote({
|
||||
parentNoteId: parentNote.noteId,
|
||||
title,
|
||||
content,
|
||||
|
||||
@@ -369,6 +369,10 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @param {Buffer} content
|
||||
*/
|
||||
function saveNote(filePath, content) {
|
||||
const {parentNoteMeta, noteMeta, attachmentMeta} = getMeta(filePath);
|
||||
|
||||
@@ -566,6 +570,7 @@ function streamToBuffer(stream) {
|
||||
return new Promise((res, rej) => stream.on('end', () => res(Buffer.concat(chunks))));
|
||||
}
|
||||
|
||||
/** @returns {Buffer} */
|
||||
function readContent(zipfile, entry) {
|
||||
return new Promise((res, rej) => {
|
||||
zipfile.openReadStream(entry, function(err, readStream) {
|
||||
|
||||
Reference in New Issue
Block a user