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

Function splitExcluding

src/utils/text.ts:152–162  ·  view source on GitHub ↗
(input: string, separator: string, excludeRanges: TextRange[])

Source from the content-addressed store, hash-verified

150}
151
152export function splitExcluding(input: string, separator: string, excludeRanges: TextRange[]): string[] {
153 const parts: string[] = [];
154 let commaIndex = -1;
155 let currIndex = 0;
156 while ((commaIndex = indexOfExcluding(input, separator, currIndex, excludeRanges)) >= 0) {
157 parts.push(input.substring(currIndex, commaIndex).trim());
158 currIndex = commaIndex + 1;
159 }
160 parts.push(input.substring(currIndex).trim());
161 return parts;
162}

Callers 2

parseSelectorsFunction · 0.90
parseDeclarationsFunction · 0.90

Calls 1

indexOfExcludingFunction · 0.85

Tested by

no test coverage detected