refactor(lib): extract shared image constants and JSON parsing utilities
Move image extensions, MIME types, and size limit into a dedicated constants module. Extract JSON-from-text parsing into a pure utility function for reuse across the codebase.
This commit is contained in:
9
src/lib/constants.ts
Normal file
9
src/lib/constants.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/** Shared constants for image handling across the app. */
|
||||
|
||||
export const IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".webp"];
|
||||
|
||||
export const IMAGE_MIME_TYPES = ["image/png", "image/jpeg", "image/webp"];
|
||||
|
||||
export const IMAGE_ACCEPT = IMAGE_MIME_TYPES.join(",");
|
||||
|
||||
export const MAX_IMAGE_SIZE_BYTES = 10 * 1024 * 1024; // 10MB
|
||||
Reference in New Issue
Block a user