@payfit/unity-components
Version:
5 lines (4 loc) • 305 B
JavaScript
//#region src/core/components/avatar/utils.ts
var e = (e) => e ? e.length <= 2 ? e : e.replace(/[^a-z0-9 ]+/gi, "").split(" ").filter(Boolean).map((e) => e.charAt(0).toUpperCase()).filter((e, t, n) => t === 0 || n.length > 0 && t === n.length - 1).join("") : "";
//#endregion
export { e as getInitials };