Add MIME.isImage
and MIME.isVideo
This commit is contained in:
parent
df2e6e7864
commit
6ff82adf0a
1 changed files with 6 additions and 6 deletions
|
@ -1,14 +1,14 @@
|
|||
export type MIMEType = string & { _mimeTypeBrand: any };
|
||||
|
||||
|
||||
export const isVideo = (value: MIMEType): boolean =>
|
||||
value.startsWith('video/') && value !== 'video/wmv';
|
||||
export const isJPEG = (value: MIMEType): boolean =>
|
||||
value === 'image/jpeg';
|
||||
|
||||
export const isImage = (value: MIMEType): boolean =>
|
||||
value.startsWith('image/') && value !== 'image/tiff';
|
||||
value.startsWith('image/');
|
||||
|
||||
export const isVideo = (value: MIMEType): boolean =>
|
||||
value.startsWith('video/');
|
||||
|
||||
export const isAudio = (value: MIMEType): boolean =>
|
||||
value.startsWith('audio/');
|
||||
|
||||
export const isJPEG = (value: MIMEType): boolean =>
|
||||
value === 'image/jpeg';
|
||||
|
|
Loading…
Add table
Reference in a new issue