Validation du type de fichier Multer

fileFilter: (req,file,callback) => {
        const types = /png|jpg|jpeg|webp|gif|webp|svg/
        const extName = types.test(path.extname(file.originalname).toLocaleLowerCase())
        const mimetype = types.test(file.mimetype)
        if(extName && mimetype){
            callback(null,true)
        } else{
            cb(new Error("Only supported png,jpeg,jpg,gif,webp and svg format image"))
        }
    }
Nazmul Hassan