/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/@testing-library/user-event/dist/utils/edit/cursorPosition.js
35 строк
919 B
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCursorAtEnd = isCursorAtEnd; exports.isCursorAtStart = isCursorAtStart; var _selectionRange = require("./selectionRange"); var _getValue2 = require("./getValue"); function isCursorAtEnd(element) { var _getValue; const { selectionStart, selectionEnd } = (0, _selectionRange.getSelectionRange)(element); return selectionStart === selectionEnd && (selectionStart != null ? selectionStart : /* istanbul ignore next */ 0) === ((_getValue = (0, _getValue2.getValue)(element)) != null ? _getValue : /* istanbul ignore next */ '').length; } function isCursorAtStart(element) { const { selectionStart, selectionEnd } = (0, _selectionRange.getSelectionRange)(element); return selectionStart === selectionEnd && (selectionStart != null ? selectionStart : /* istanbul ignore next */ 0) === 0; }