'use strict'
function textParser(times, type) {
  let prefix = ''
  switch (type) {
    case 'current':
      prefix = '👁  Time in currently watching:'
      break;
    case 'completed':
      prefix = '😎  Time in completed:'
      break;
    case 'on_hold':
      prefix = '🤔  Time in on-hold:'
      break;
    case 'dropped':
      prefix = '😕  Time in dropped:'
      break;
    default:
      prefix = '❤️  Time spent in anime:'
      break;
  }

  return prefix + ` ${times.months} months, ${times.days} days, ${times.hours} hours, ${times.mins} mins`
}

module.exports = {
  textParser
}

@@ -10,113 +10,66 @@
 ct'%0A
-function textParser(times, type) %7B%0A  let prefix = ''%0A  switch (type)
+const _ = require('lodash');%0Aconst PREFIXES =
  %7B%0A  
- 
- case 'current':%0A      prefix =
+current:
  '%F0%9F%91%81 
@@ -101,130 +101,58 @@
 ng:'
+,
 %0A  
-    break;%0A    case 'completed':%0A      prefix = '%F0%9F%98%8E  Time in completed:'%0A      break;%0A    case 'on_hold':%0A      prefix =
+completed: '%F0%9F%98%8E  Time in completed:',%0A  on_hold:
  '%F0%9F%A4%94 
@@ -173,56 +173,20 @@
 ld:'
+,
 %0A  
-    break;%0A    case 'dropped':%0A      prefix =
+dropped:
  '%F0%9F%98%95 
@@ -207,94 +207,135 @@
 ed:'
+,
 %0A  
-    break;%0A    default:%0A      prefix = '%E2%9D%A4%EF%B8%8F  Time spent in anime:'%0A      break;%0A  %7D%0A
+all: '%E2%9D%A4%EF%B8%8F  Time spent in anime:'%0A%7D%0A%0Afunction textParser(times, type) %7B%0A  let prefix = PREFIXES%5B_.isNil(type) ? 'all' : type%5D
 %0A  r

refactor text parser