MCPcopy Create free account
hub / github.com/TanStack/query / originalPosition

Function originalPosition

packages/query-devtools/src/Explorer.tsx:410–420  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

408 let originalEnd = 0
409 let lowercaseEnd = 0
410 const originalPosition = (index: number) => {
411 while (lowercaseEnd <= index) {
412 const character = String.fromCodePoint(
413 props.text.codePointAt(originalEnd)!,
414 )
415 originalStart = originalEnd
416 originalEnd += character.length
417 lowercaseEnd += character.toLowerCase().length
418 }
419 return { start: originalStart, end: originalEnd }
420 }
421 const ranges: Array<{ start: number; end: number }> = []
422 let index = lower.indexOf(term)
423 while (index !== -1 && ranges.length < MAX_HIGHLIGHT_RANGES) {

Callers 1

HighlightedTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected