@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
1 lines • 838 B
Source Map (JSON)
{"version":3,"file":"utils.cjs","sources":["../../../components/avatar/utils.js"],"sourcesContent":["export const extractInitialsFromName = (fullName) => {\n if (typeof fullName !== 'string' || !fullName.trim()) return '';\n\n const names = fullName.trim().split(/\\s+/g);\n\n return names.length === 1\n ? names.join('').substring(0, 2)\n : names.filter((_, index) => (index === 0 || index === names.length - 1))\n .map(name => name.slice(0, 1).toUpperCase())\n .join('');\n};\n"],"names":[],"mappings":";;AAAY,MAAC,0BAA0B,CAAC,aAAa;AACnD,MAAI,OAAO,aAAa,YAAY,CAAC,SAAS,KAAI,EAAI,QAAO;AAE7D,QAAM,QAAQ,SAAS,KAAM,EAAC,MAAM,MAAM;AAE1C,SAAO,MAAM,WAAW,IACpB,MAAM,KAAK,EAAE,EAAE,UAAU,GAAG,CAAC,IAC7B,MAAM,OAAO,CAAC,GAAG,UAAW,UAAU,KAAK,UAAU,MAAM,SAAS,CAAE,EACrE,IAAI,UAAQ,KAAK,MAAM,GAAG,CAAC,EAAE,aAAa,EAC1C,KAAK,EAAE;AACd;;"}