getHighlightSegments
getHighlightSegments(
text,query,caseSensitive?):HighlightSegment[]
Defined in: src/components/feedback/LogView/logViewUtils.ts:21
Split text into alternating non-match / match segments for query.
Pure and allocation-light: an empty (or whitespace-only) query returns a
single non-match segment so callers can render uniformly. Matching is
case-insensitive unless caseSensitive is set. All occurrences are marked.
Parameters
text
string
query
string
caseSensitive?
boolean = false
Returns
Example
getHighlightSegments('abcABC', 'bc')// → [{text:'a',match:false},{text:'bc',match:true},// {text:'A',match:false},{text:'BC',match:true}]