getTitle = asyncapi => {
  const info = getInfo(asyncapi);
  if (!info.title) {
    throw new Error('Provided AsyncAPI document info field doesn\'t contain title.');
  }
  const title = info.title();
  if (title === '') {
    throw new Error('AsyncAPI document title cannot be an empty string.');
  }
  
  return title;
}
Validate and retrieve the AsyncAPI title parameter in the info object.

Throws an error if the provided AsyncAPI info object lacks a `title` parameter.

@param {object} asyncapi - The AsyncAPI document object.
@throws {Error} When `title` is `null` or `undefined` or `empty string`  .
@returns {string} The retrieved `title` parameter.