session-desktop/ts/types/MIME.ts
Daniel Gasienica 424965f876 🎨 Autoformat code
2018-04-25 15:24:51 -04:00

12 lines
401 B
TypeScript

/**
* @prettier
*/
export type MIMEType = string & { _mimeTypeBrand: any };
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/');