server-ts: Address requested changes

This commit is contained in:
Elian Doran
2024-03-30 10:49:40 +02:00
parent 5e5add7e47
commit 3eb7ed5dda
11 changed files with 40 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
const fs = require("fs");
const sanitize = require("sanitize-filename");
const sql = require('./sql');
const sql = require('./sql.js');
const decryptService = require('./decrypt.js');
const dataKeyService = require('./data_key.js');
const extensionService = require('./extension.js');
@@ -74,7 +74,7 @@ function dumpDocument(documentPath, targetPath, options) {
return;
}
let {content} = sql.getRow("SELECT content FROM blobs WHERE blobId = ?", [noteRow.blobId]);
let { content } = sql.getRow("SELECT content FROM blobs WHERE blobId = ?", [noteRow.blobId]);
if (content !== null && noteRow.isProtected && dataKey) {
content = decryptService.decrypt(dataKey, content);
@@ -108,7 +108,7 @@ function dumpDocument(documentPath, targetPath, options) {
}
try {
fs.mkdirSync(childTargetPath, {recursive: true});
fs.mkdirSync(childTargetPath, { recursive: true });
}
catch (e) {
console.error(`DUMPERROR: Creating directory ${childTargetPath} failed with error '${e.message}'`);
@@ -157,7 +157,7 @@ function validatePaths(documentPath, targetPath) {
}
if (!fs.existsSync(targetPath)) {
const ret = fs.mkdirSync(targetPath, {recursive: true});
const ret = fs.mkdirSync(targetPath, { recursive: true });
if (!ret) {
console.error(`Target path '${targetPath}' could not be created. Run with --help to see usage.`);