리펙토링: 전체 구조 검토, 개선

This commit is contained in:
2026-05-15 22:58:46 +09:00
parent 391a8c59a5
commit 1e88859484
6 changed files with 61 additions and 20 deletions
+7 -4
View File
@@ -26,10 +26,13 @@ function register() {
try {
const data = fs.readFileSync(filePath);
const ext = path.extname(filePath).toLowerCase().replace('.', '');
const mime = (ext === 'jpg' || ext === 'jpeg') ? 'jpeg'
: ext === 'png' ? 'png'
: ext === 'gif' ? 'gif'
: ext === 'webp' ? 'webp'
const mime = (ext === 'jpg' || ext === 'jpeg') ? 'jpeg'
: ext === 'png' ? 'png'
: ext === 'gif' ? 'gif'
: ext === 'webp' ? 'webp'
: (ext === 'tiff' || ext === 'tif') ? 'tiff'
: ext === 'bmp' ? 'bmp'
: (ext === 'heic' || ext === 'heif') ? 'heic'
: 'jpeg';
return `data:image/${mime};base64,${data.toString('base64')}`;
} catch (e) {