UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

19 lines 561 B
export const crumbMaxCharName = (crumb, charLimit, overflow, lastCrumb) => { let modify = true; if (lastCrumb) { if (overflow) { modify = true; } else { modify = false; } } if (crumb.name.length > charLimit && modify) { const copyCrumb = { ...crumb }; const crumbName = copyCrumb.name.split('').splice(0, charLimit).join('').concat('...'); copyCrumb.name = crumbName; return copyCrumb; } return crumb; }; //# sourceMappingURL=crumbMaxCharName.js.map