Port `MIME` module to TypeScript
parent
6a63e427c8
commit
df2e6e7864
@ -1,10 +0,0 @@
|
||||
exports.isJPEG = mimeType =>
|
||||
mimeType === 'image/jpeg';
|
||||
|
||||
exports.isVideo = mimeType =>
|
||||
mimeType.startsWith('video/') && mimeType !== 'video/wmv';
|
||||
|
||||
exports.isImage = mimeType =>
|
||||
mimeType.startsWith('image/') && mimeType !== 'image/tiff';
|
||||
|
||||
exports.isAudio = mimeType => mimeType.startsWith('audio/');
|
@ -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';
|
||||
|
Loading…
Reference in New Issue