1//if you want to get Mime type use this one
2
3const body = {profilepic:"data:image/png;base64,abcdefghijklmnopqrstuvwxyz0123456789"};
4let mimeType = body.profilepic.match(/[^:]\w+\/[\w-+\d.]+(?=;|,)/)[0];
5
6//===========================================
7
8//if you want to get only type of it like (png, jpg) etc
9
10const body2 = {profilepic:"data:image/png;base64,abcdefghijklmnopqrstuvwxyz0123456789"};
11let mimeType2 = body2.profilepic.match(/[^:/]\w+(?=;|,)/)[0];