/
revenore
/
ShopBot
Обзор
Документация
Войти
/
revenore
/
ShopBot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/strings.ts
22 строки
606 B
roules
Shop Bot 2 (#7)
22 мар 2025, 17:59
Не верифицирован
22 мар 2025, 17:59
aec1c44
Код
Авторство
О чём код?
interface String { ellipsis(max: number) : string removeCustomEmojis() : string replaceSpaces(by?: string) : string } String.prototype.ellipsis = function (this : string, max: number) { const str = this if (str.length > max) return `${str.substring(0, max - 1)}…` return str } String.prototype.removeCustomEmojis = function (this: string): string { const str = this return str.replace(/<:[a-zA-Z0-9_]{2,32}:[0-9]{17,19}>/g, '') } String.prototype.replaceSpaces = function (this: string, by: ' '): string{ const str = this return str.replace(/[\s ]/g, ' ') }