Extract common MIME types
This commit is contained in:
parent
8a4f062120
commit
fa4c3fda2b
3 changed files with 13 additions and 9 deletions
|
@ -1,8 +1,12 @@
|
|||
export type MIMEType = string & { _mimeTypeBrand: any };
|
||||
|
||||
export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType;
|
||||
export const IMAGE_GIF = 'image/gif' as MIMEType;
|
||||
export const IMAGE_JPEG = 'image/jpeg' as MIMEType;
|
||||
export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType;
|
||||
|
||||
export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg';
|
||||
export const isImage = (value: MIMEType): boolean => value.startsWith('image/');
|
||||
export const isVideo = (value: MIMEType): boolean => value.startsWith('video/');
|
||||
export const isAudio = (value: MIMEType): boolean => value.startsWith('audio/');
|
||||
|
||||
export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue