MCPcopy
hub / github.com/basecamp/trix / getStringAtRange

Method getStringAtRange

src/trix/models/document.js:441–449  ·  view source on GitHub ↗
(range)

Source from the content-addressed store, hash-verified

439 }
440
441 getStringAtRange(range) {
442 let endIndex
443 const array = range = normalizeRange(range),
444 endPosition = array[array.length - 1]
445 if (endPosition !== this.getLength()) {
446 endIndex = -1
447 }
448 return this.getDocumentAtRange(range).toString().slice(0, endIndex)
449 }
450
451 getBlockAtIndex(index) {
452 return this.blockList.getObjectAtIndex(index)

Calls 5

getLengthMethod · 0.95
getDocumentAtRangeMethod · 0.95
normalizeRangeFunction · 0.90
sliceMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected