refactor: minor code cleanups

This commit is contained in:
Carlos Valente
2024-06-23 22:24:09 +02:00
committed by Carlos Valente
parent 61280b06b7
commit de9af5aaa2
2 changed files with 8 additions and 5 deletions
+4 -4
View File
@@ -1,28 +1,28 @@
/* eslint-disable no-console */
/**
* Utility function to log messages in green
* Utility function to log success messages
*/
export function consoleSuccess(message: string) {
console.log(inGreen(message));
}
/**
* Utility function to log messages in red
* Utility function to log error messages
*/
export function consoleError(message: string) {
console.error(inRed(message));
}
/**
* Utility function to log messages with dimmed appearance
* Utility function to log highlighted messages
*/
export function consoleHighlight(message: string) {
console.log(inCyan(message));
}
/**
* Utility function to log messages with dimmed appearance
* Utility function to log messages with subdued appearance
*/
export function consoleSubdued(message: string) {
console.log(inGray(message));
+4 -1
View File
@@ -58,10 +58,13 @@ export const storage = multer.diskStorage({
},
});
/**
* Clears the directory that holds the uploads
*/
export async function clearUploadfolder() {
try {
await rm(uploadsFolderPath, { recursive: true });
} catch (_) {
//we dont care that there was no folder
// we dont care that there was no folder
}
}