'use strict';

const capitalize = s => s && s[0].toUpperCase() + s.slice(1);
const isValidURL = str => {
  let url;
  try {
    url = new URL(str);
  }
  catch (_) {
    return false;
  }
  return url.protocol === 'http:' || url.protocol === 'https:';
};

exports.capitalize = capitalize;
exports.isValidURL = isValidURL;
