Implement textSearch(text, term) — scan a string and wrap every occurrence of a single search term in <mark> … </mark> tags, the way a browser's find-on-page highlights the word you searched for. Matching is case-insensitive (the term react finds React), but the output keeps the text's original casing. The term is a plain string, so a character like + or . inside it must match literally — a.b should find the text a.b, not behave like a regular expression.
// text: string — the source text to search within.
// term: string — the single term to highlight (case-insensitive, matched literally).
// returns: string
// The same text with each occurrence of term wrapped in <mark>…</mark>.
// Original casing is preserved; nothing else changes.
function textSearch(text, term): string;
// The one occurrence of 'cat' is wrapped; everything else is untouched.
textSearch('the cat sat', 'cat');
// → 'the <mark>cat</mark> sat'
// Case-insensitive match, but the original 'React' casing is kept in the output.
textSearch('React is great', 'react');
// → '<mark>React</mark> is great'
<mark> … </mark> pair. Adjacent matches are wrapped separately: textSearch('aaa', 'a') is <mark>a</mark><mark>a</mark><mark>a</mark>.react matches React, REACT, or reAct, but the wrapped text is exactly what appeared in the source — you never lowercase the output.c++, a.b, or (x) must match those exact characters. Escape regex-special characters before searching so they lose their special meaning.term (or empty text) returns the text unchanged — don't wrap a zero-length match.cat matches inside category.