'use strict';

function getInitials(name) {
  if (name.length === 2 && /^[A-Z]{2}$/.test(name)) {
    return name;
  }
  const allInitials = name.split(' ').filter(part => !startsWithParenthesis(part)).map(part => part[0]).join('').toUpperCase();
  if (allInitials.length === 1) {
    return allInitials[0];
  }
  return allInitials[0] + allInitials.slice(-1);
  function startsWithParenthesis(part) {
    return /^[({[<]/.test(part);
  }
}

exports.getInitials = getInitials;
//# sourceMappingURL=initials.js.map
