/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/plugins/console/list/common.ts
17 строк
303 B
D-Sketon
refactor: refact types (#5271)
31 окт 2023, 15:52
Не верифицирован
31 окт 2023, 15:52
b898f29
Код
Авторство
О чём код?
import strip from 'strip-ansi'; export function stringLength(str: string): number { str = strip(str); const len = str.length; let result = len; // Detect double-byte characters for (let i = 0; i < len; i++) { if (str.charCodeAt(i) > 255) { result++; } } return result; }