Resolve linter issues, add unit tests, adjust test coverage

This commit is contained in:
2026-02-07 12:24:39 -03:00
parent 430248a4ef
commit 3264b12ea6
45 changed files with 12143 additions and 7918 deletions

View File

@@ -3,7 +3,13 @@ import path from 'path';
import { randomUUID } from 'crypto';
import type { Env } from './env.js';
const IMAGE_MIME = ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml'];
const IMAGE_MIME = [
'image/jpeg',
'image/png',
'image/gif',
'image/webp',
'image/svg+xml',
];
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
export function createMulter(env: Env) {
@@ -20,7 +26,11 @@ export function createMulter(env: Env) {
if (IMAGE_MIME.includes(file.mimetype)) {
cb(null, true);
} else {
cb(new Error('Only image files (jpeg, png, gif, webp) are allowed'));
cb(
new Error(
'Only image files (jpeg, png, gif, webp) are allowed',
),
);
}
},
});