all files / src/ caret.js

100% Statements 4/4
100% Branches 2/2
100% Functions 3/3
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13   119×         137×        
module.exports = {
  start (el) {
    return el.selectionStart
  },
  end (el) {
    return el.selectionEnd
  },
  set (el, start, end) {
    el.setSelectionRange(start, end || start)
  }
}