stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
17 lines • 583 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTrimmedAttachmentTitle = void 0;
var getTrimmedAttachmentTitle = (title, maxLength) => {
var maxLengthValue = maxLength || 18;
if (!title) return '';
var ellipsis = '...';
if (title.length <= maxLengthValue) {
return title;
}
var start = title.slice(0, maxLengthValue / 2);
var end = title.slice(title.length - maxLengthValue / 2);
return `${start}${ellipsis}${end}`;
};
exports.getTrimmedAttachmentTitle = getTrimmedAttachmentTitle;
//# sourceMappingURL=getTrimmedAttachmentTitle.js.map