/
dany
/
ReshenijaBotInformationSite
Обзор
Документация
Войти
/
dany
/
ReshenijaBotInformationSite
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
node_modules/string-length/index.js
19 строк
343 B
Daniil
Initial commit
31 окт 2023, 01:10
31 окт 2023, 01:10
a171ae1
Код
Авторство
О чём код?
'use strict'; const stripAnsi = require('strip-ansi'); const charRegex = require('char-regex'); const stringLength = string => { if (string === '') { return 0; } const strippedString = stripAnsi(string); if (strippedString === '') { return 0; } return strippedString.match(charRegex()).length; }; module.exports = stringLength;