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.
10 lines
324 B
TypeScript
10 lines
324 B
TypeScript
/** 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
|