export const typeMarry = (type) => {
const charts = ["pie","bar","line"],
text = ["normalText","multText"],
media = ["file","picture","music","video"]
if(charts.indexOf(type) !== -1) {
return "CHARTS"
}
if(text.indexOf(type) !== -1) {
return "TEXT"
}
if(media.indexOf(type) !== -1) {
return "MEDIA"
}
}
how is this method rewritten into maintainable overwriting, similar to policy mode?