From 6ff82adf0a8a9d8a2d5281233aec80652a355c95 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Mon, 9 Apr 2018 19:24:47 -0400 Subject: [PATCH] Add `MIME.isImage` and `MIME.isVideo` --- ts/types/MIME.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ts/types/MIME.ts b/ts/types/MIME.ts index ed1e3b5fd..3ac85dbfb 100644 --- a/ts/types/MIME.ts +++ b/ts/types/MIME.ts @@ -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';