function consoleMessage(message, type = 'info') {
  let labelColor = '';

  switch (type) {
    case 'error':
      labelColor = '#EA4335';
      break;

    case 'warn':
      labelColor = '#E1A804';
      break;

    default:
      labelColor = '#4285F4';
      break;
  }

  return [
    `%c[${type.toUpperCase()}]%c ${message}`,
    `color: ${labelColor}`,
    'color: unset',
  ];
}
Returns a formatted message to be logged in console
prefixed with a type.

@param {string} message
The message to be logged in the console

@param {"info" | "error" | "warn"} type
Type of the message

@returns {string[]}
List of strings with formatting to be printed in console.
Use `...` operator to unpack the list as parameters to the
console function.

@example <caption>Passing to `console.log`</caption>
console.log(...consoleMessage('This is an info', 'info'));

@example <caption>Passing to `console.group`</caption>
console.group(...consoleMessage('This is an error', 'error'));
console.error(error);
console.groupEnd();