/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v6.2.2
shared/common-adapters/input.shared.tsx
29 строк
876 B
chrisnojima
new jsx and remove stories (#25359)
20 дек 2022, 17:38
Не верифицирован
20 дек 2022, 17:38
bba5de9
Код
Авторство
О чём код?
// TODO: PlainInput depends on this file, so migrate it over if/when Input is deprecated. import type {TextInfo} from './input' import './input.css' const checkTextInfo = ({text, selection}: TextInfo) => { if (selection.end === null) { throw new Error('selection.end null') } if (selection.start === null) { throw new Error('selection.start null') } if (selection.end > text.length) { throw new Error(`selection end=${selection.end} must be <= text length=${text.length}`) } if (selection.end < 0) { throw new Error(`selection end=${selection.end} must be >= 0`) } if (selection.start > selection.end) { throw new Error(`selection start=${selection.start} must be <= selection end=${selection.end}`) } if (selection.start < 0) { throw new Error(`selection start=${selection.start} must be >= 0`) } } export {checkTextInfo}