import "core-js/modules/es.regexp.exec.js";
const titleCase = input => input[0].toLocaleUpperCase() + input.slice(1);
export default (value => {
  const input = value.toString().trim();
  if (input === '') return '';
  if (input.length === 1) return input.toLocaleUpperCase();
  const match = input.match(/[a-zA-Z0-9]+/g);
  if (match) {
    return match.map(m => titleCase(m)).join('');
  }
  return input;
});