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

Function getGroup

src/inject/dynamic-theme/stylesheet-modifier.ts:208–224  ·  view source on GitHub ↗
(rule: CSSRule)

Source from the content-addressed store, hash-verified

206 const groupRefs = new WeakMap<CSSRule, ReadyGroup>();
207
208 function getGroup(rule: CSSRule): ReadyGroup {
209 if (rule == null) {
210 return rootReadyGroup;
211 }
212
213 if (groupRefs.has(rule)) {
214 return groupRefs.get(rule)!;
215 }
216
217 const group: ReadyGroup = {rule, rules: [], isGroup: true};
218 groupRefs.set(rule, group);
219
220 const parentGroup = getGroup(rule.parentRule!);
221 parentGroup.rules.push(group);
222
223 return group;
224 }
225
226 varTypeChangeCleaners.forEach((clear) => clear());
227 varTypeChangeCleaners.clear();

Callers 1

modifySheetFunction · 0.85

Calls 3

hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected