Port MIME module to TypeScript

This commit is contained in:
Daniel Gasienica 2018-04-09 19:24:24 -04:00
parent 6a63e427c8
commit df2e6e7864
7 changed files with 25 additions and 24 deletions

View file

@ -1 +1,14 @@
export type MIMEType = string & { _mimeTypeBrand: any };
export const isVideo = (value: MIMEType): boolean =>
value.startsWith('video/') && value !== 'video/wmv';
export const isImage = (value: MIMEType): boolean =>
value.startsWith('image/') && value !== 'image/tiff';
export const isAudio = (value: MIMEType): boolean =>
value.startsWith('audio/');
export const isJPEG = (value: MIMEType): boolean =>
value === 'image/jpeg';