MCPcopy
hub / github.com/darkreader/darkreader / getIndices

Function getIndices

src/inject/dynamic-theme/modify-css.ts:434–441  ·  view source on GitHub ↗
(matches: string[])

Source from the content-addressed store, hash-verified

432 }
433
434 const getIndices = (matches: string[]) => {
435 let index = 0;
436 return matches.map((match) => {
437 const valueIndex = value.indexOf(match, index);
438 index = valueIndex + match.length;
439 return {match, index: valueIndex};
440 });
441 };
442
443 const matches: BgImageMatches[] =
444 (gradients.map((i) => ({type: 'gradient', ...i})) as BgImageMatches[])

Callers 1

getBgImageModifierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected