getInitials.js 149 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 export default (name = '') => name .replace(/\s+/, ' ') .split(' ') .slice(0, 2) .map(v => v && v[0].toUpperCase()) .join('');