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

Function originalPosition

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

Source from the content-addressed store, hash-verified

376 let originalEnd = 0
377 let lowercaseEnd = 0
378 const originalPosition = (index: number) => {
379 while (lowercaseEnd <= index) {
380 const character = String.fromCodePoint(
381 props.text.codePointAt(originalEnd)!,
382 )
383 originalStart = originalEnd
384 originalEnd += character.length
385 lowercaseEnd += character.toLowerCase().length
386 }
387 return { start: originalStart, end: originalEnd }
388 }
389 const ranges: Array<{ start: number; end: number }> = []
390 let index = lower.indexOf(term)
391 while (index !== -1 && ranges.length < MAX_HIGHLIGHT_RANGES) {

Callers 1

HighlightedTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected