{"size": 406, "ext": "js", "max_stars_repo_path": "colormsg.js", "max_stars_repo_name": "webdacjs/console-hue", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "colormsg.js", "max_issues_repo_name": "webdacjs/console-hue", "max_issues_repo_issues_event_min_datetime": "2019-03-11T11:08:41.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-18T11:01:24.000Z", "max_forks_repo_path": "colormsg.js", "max_forks_repo_name": "webdacjs/console-hue", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 25.375, "max_line_length": 70, "alphanum_fraction": 0.6674876847}
const shouldStringify = ['Object', 'Array']
const msgTypes = require('./msgTypes')()

function getStr (msg, original = false) {
  if (!msg || original) {
    return msg
  } else if (shouldStringify.includes(msg.constructor.name)) {
    return JSON.stringify(msg)
  }
  return msg
}

module.exports = function (type, msg, original) {
  return `${msgTypes[type]}${getStr(msg, original)}${msgTypes['log']}`
}
