code: function message(key, args) {
    if (typeof key !== 'string') throw new Error('Error message key must be a string');
    const msg = messages.get(key);
    if (!msg) throw new Error(`An invalid error message key was used: ${key}.`);
    if (typeof msg === 'function') return msg(...args);
    if (args === undefined || args.length === 0) return msg;
    args.unshift(msg);
    return String(...args);
  }
docs: Format the message for an error.
  @param {string} key Error key
  @param {Array<*>} args Arguments to pass for util format or as function args
  @returns {string} Formatted string