2 import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
3 import { isFileValid } from './misc'
5 const imageMimeTypes = CONSTRAINTS_FIELDS.ACTORS.IMAGE.EXTNAME
6 .map(v => v.replace('.', ''))
8 const imageMimeTypesRegex = `image/(${imageMimeTypes})`
9 function isActorImageFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], fieldname: string) {
10 return isFileValid(files, imageMimeTypesRegex, fieldname, CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max)
13 // ---------------------------------------------------------------------------