- updated code related to files validation;
This commit is contained in:
19
src/helpers/getPropeMimeLabels.js
Normal file
19
src/helpers/getPropeMimeLabels.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { head } from 'ramda';
|
||||
import { mimeTypes } from '../configData';
|
||||
|
||||
const getPropeMimeLabels = (accept) => {
|
||||
return accept
|
||||
.map(v => {
|
||||
const found = head(mimeTypes.filter(o => o.code.includes(v)));
|
||||
let res = v;
|
||||
|
||||
if (found) {
|
||||
res = found.name;
|
||||
}
|
||||
|
||||
return res;
|
||||
})
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
export default getPropeMimeLabels;
|
||||
Reference in New Issue
Block a user