session-desktop/ts/types/MIME.ts

10 lines
398 B
TypeScript
Raw Normal View History

2018-04-13 22:25:52 +02:00
/**
* @prettier
*/
2018-04-12 00:35:24 +02:00
export type MIMEType = string & { _mimeTypeBrand: any };
2018-04-10 01:24:24 +02:00
2018-04-13 22:25:52 +02:00
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/');