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

Function formatSitesFixesConfig

src/generators/utils/format.ts:15–42  ·  view source on GitHub ↗
(fixes: SiteFix[], options: SitesFixesFormatOptions)

Source from the content-addressed store, hash-verified

13}
14
15export function formatSitesFixesConfig(fixes: SiteFix[], options: SitesFixesFormatOptions): string {
16 const lines: string[] = [];
17
18 fixes.forEach((fix, i) => {
19 push(lines, fix.url);
20 options.props.forEach((prop) => {
21 const command = options.getPropCommandName(prop);
22 const value = fix[prop];
23 if (options.shouldIgnoreProp(prop, value)) {
24 return;
25 }
26 lines.push('');
27 lines.push(command);
28 const formattedValue = options.formatPropValue(prop, value);
29 if (formattedValue) {
30 lines.push(formattedValue);
31 }
32 });
33 if (i < fixes.length - 1) {
34 lines.push('');
35 lines.push('='.repeat(32));
36 lines.push('');
37 }
38 });
39
40 lines.push('');
41 return lines.join('\n');
42}

Callers 4

formatDetectorHintsFunction · 0.90
formatDynamicThemeFixesFunction · 0.90
formatStaticThemesFunction · 0.90
formatInversionFixesFunction · 0.90

Calls 1

pushFunction · 0.90

Tested by

no test coverage detected