const endMessage = (text: string) => {
if (/ |^\[club\d+\|.*?\]/.test(text)) {
return text;
}
const firstSymbol = /[a-zа-яё_]/i.test(text[0]) ? text[0].toUpperCase() : text[0];
const lastSymbol = /[a-zа-яё_]/i.test(text[text.length - 1]) ? '.' : '';
return `${firstSymbol}${text.slice(1)}${lastSymbol}`
};
const endMessage = (text: string) => {
if (/ |^\[club\d+\|.*?\]/.test(text)) {
return text;
}
return `${text[0].toUpperCase()}${text.slice(1)}${/[a-zа-яё_]/i.test(text[text.length - 1]) ? '.' : ''}`
};
const endMessage = (text: string) => {
if (/ |^\[club\d+\|.*?\]/.test(text)) {
return text;
}
let newText = text;
if (/[a-zа-яё_]/i.test(text[0])) {
newText = `${text[0].toUpperCase()}${text.slice(1)}`;
}
if (/[a-zа-яё_]/i.test(text[text.length - 1])) {
newText = `${newText}.`;
}
return newText;
};
getState: BaseUserInfo['getState']