MCPcopy Index your code
hub / github.com/darkreader/darkreader / indexOfExcluding

Function indexOfExcluding

src/utils/text.ts:143–150  ·  view source on GitHub ↗
(input: string, search: string, position: number, excludeRanges: TextRange[])

Source from the content-addressed store, hash-verified

141}
142
143function indexOfExcluding(input: string, search: string, position: number, excludeRanges: TextRange[]) {
144 const i = input.indexOf(search, position);
145 const exclusion = excludeRanges.find((r) => i >= r.start && i < r.end);
146 if (exclusion) {
147 return indexOfExcluding(input, search, exclusion.end, excludeRanges);
148 }
149 return i;
150}
151
152export function splitExcluding(input: string, separator: string, excludeRanges: TextRange[]): string[] {
153 const parts: string[] = [];

Callers 2

getOpenCloseRangeFunction · 0.85
splitExcludingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected