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

23 lines 711 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.crumbMaxCharName = void 0; 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; }; exports.crumbMaxCharName = crumbMaxCharName; //# sourceMappingURL=crumbMaxCharName.js.map