function validBaseUrl(baseUrl) {
  try {
    new URL(baseUrl);
    return true;
  } catch (e) {
    return false;
  }
}
Validates if the provided baseUrl is a valid URL at all.
@param {string} baseUrl
@returns {boolean}