Files
Signal-Desktop/ts/types/MIME.ts
2018-04-25 15:24:50 -04:00

15 lines
440 B
TypeScript

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';