{"size": 382, "ext": "js", "max_stars_repo_path": "src/util/getNameInitials.js", "max_stars_repo_name": "omerson-cruz/pollen", "max_stars_repo_stars_event_min_datetime": "2020-06-10T05:24:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-24T05:24:59.000Z", "max_issues_repo_path": "src/util/getNameInitials.js", "max_issues_repo_name": "omerson-cruz/pollen", "max_issues_repo_issues_event_min_datetime": "2020-07-02T15:31:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:21:38.000Z", "max_forks_repo_path": "src/util/getNameInitials.js", "max_forks_repo_name": "omerson-cruz/pollen", "max_forks_repo_forks_event_min_datetime": "2020-07-15T02:49:25.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T22:40:14.000Z"}
{"max_stars_count": 13, "max_issues_count": 102, "max_forks_count": 6, "avg_line_length": 25.4666666667, "max_line_length": 75, "alphanum_fraction": 0.6701570681}
/**
 * Takes a full name, and returns the first and last initials if available.
 * @param {String} name
 * @returns {String}
 */
function getNameInitials(name) {
  const names = (name || '').split(' ');
  const firstInitial = names[0].charAt(0);
  return names.length > 1
    ? firstInitial + names[names.length - 1].charAt(0)
    : firstInitial;
}

export default getNameInitials;
