(name: string)
| 1 | export function getInitials(name: string) { |
| 2 | const onlyLetters = name.replace(/[^a-zA-Z ]/g, '').toUpperCase(); |
| 3 | const words = onlyLetters.split(' '); |
| 4 | const initials = words.map((word) => word[0]); |
| 5 | return initials.join('').slice(0, 3); |
| 6 | } |
no outgoing calls
no test coverage detected