MCPcopy Index your code
hub / github.com/tinyplex/tinybase / highlighted

Function highlighted

site/js/common/search.ts:199–209  ·  view source on GitHub ↗
(element: HTMLElement, str: string, value: string)

Source from the content-addressed store, hash-verified

197
198// Highlight search fragment in text
199const highlighted = (element: HTMLElement, str: string, value: string) => {
200 const location = str.toLowerCase().indexOf(value);
201 element.innerHTML =
202 location == -1
203 ? str
204 : str.substring(0, location) +
205 '<em>' +
206 str.substring(location, location + value.length) +
207 '</em>' +
208 str.substring(location + value.length);
209};
210
211// Move hover class through the results
212const moveHover = (current: any, next: any) => {

Callers 1

populateResultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…