oktopus/frontend/src/utils/get-initials.js
Leandro Antônio Farias Machado d297fecc62 chore: create proj structure
2023-03-07 13:33:32 +00:00

7 lines
151 B
JavaScript

export const getInitials = (name = '') => name
.replace(/\s+/, ' ')
.split(' ')
.slice(0, 2)
.map((v) => v && v[0].toUpperCase())
.join('');