chore(prettier): fix all files

This commit is contained in:
Elian Doran
2025-01-09 18:07:02 +02:00
parent 19ee861699
commit 4cbb529fd4
571 changed files with 23226 additions and 23940 deletions

View File

@@ -5,15 +5,17 @@ function getFileName(note: any, childTargetPath: string, safeTitle: string) {
let existingExtension = path.extname(safeTitle).toLowerCase();
let newExtension;
if (note.type === 'text') {
newExtension = 'html';
} else if (note.mime === 'application/x-javascript' || note.mime === 'text/javascript') {
newExtension = 'js';
} else if (existingExtension.length > 0) { // if the page already has an extension, then we'll just keep it
if (note.type === "text") {
newExtension = "html";
} else if (note.mime === "application/x-javascript" || note.mime === "text/javascript") {
newExtension = "js";
} else if (existingExtension.length > 0) {
// if the page already has an extension, then we'll just keep it
newExtension = null;
} else {
if (note.mime?.toLowerCase()?.trim() === "image/jpg") { // image/jpg is invalid but pretty common
newExtension = 'jpg';
if (note.mime?.toLowerCase()?.trim() === "image/jpg") {
// image/jpg is invalid but pretty common
newExtension = "jpg";
} else {
newExtension = mimeTypes.extension(note.mime) || "dat";
}