UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

14 lines (11 loc) 348 B
'use client'; 'use strict'; function getInitials(name, limit = 2) { const splitted = name.split(" "); if (splitted.length === 1) { return name.slice(0, limit).toUpperCase(); } return splitted.map((word) => word[0]).slice(0, limit).join("").toUpperCase(); } exports.getInitials = getInitials; //# sourceMappingURL=get-initials.cjs.map