message: Refactor profile function
diff: -setup.profile = function (obj, base, type) {
  - // this is a function that returns the profile widget for the provided object.
  - // obj is the object. It is mandatory.
  - // type is the type of object it is- it points towards npcs as a default.
  - // For buildings, point towards town.buildings.tavern
  - // For factions, point towards town.factions
  +/**
  + * This is a function that returns the profile widget for the provided object.
  + * @param obj - The object. It is mandatory.
  + * @param type - The type of object it is- it points towards npcs as a default.
  + * For buildings, point towards town.buildings.tavern
  + * For factions, point towards `town.factions`
  + */
  +setup.profile = (obj, base, type) => {
  type = type || 'npcs'
  if (typeof obj === 'string') {
  - console.error('Profile function for ' + obj + ' called with a string.')
  + console.error(`Profile function for ${obj} called with a string.`)
  obj = State.variables[type][obj]
  }
  - // base is the user-facing text
  - base = base || obj.name || obj.race
  + // the user-facing text
  + const text = JSON.stringify(base || obj.name || obj.race)
  - return '<<profile `$' + type + '[' + JSON.stringify(obj.key) + '] `' + JSON.stringify(base) + '>>'
  + const key = JSON.stringify(obj.key)
  +
  + return `<<profile \`$${type}[${key}] \`${text}>>`
  }
  