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

Function getVariablesMatches

src/inject/dynamic-theme/variables.ts:645–655  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

643}
644
645function getVariablesMatches(input: string): VariableMatch[] {
646 const ranges: VariableMatch[] = [];
647 let i = 0;
648 let range: Range | null;
649 while ((range = getVariableRange(input, i))) {
650 const {start, end} = range;
651 ranges.push({start, end, value: input.substring(start, end)});
652 i = range.end + 1;
653 }
654 return ranges;
655}
656
657function replaceVariablesMatches(input: string, replacer: (match: string, count: number) => string | null) {
658 const matches = getVariablesMatches(input);

Callers 1

replaceVariablesMatchesFunction · 0.85

Calls 1

getVariableRangeFunction · 0.85

Tested by

no test coverage detected