(fixes: SiteFix[], options: SitesFixesFormatOptions)
| 13 | } |
| 14 | |
| 15 | export 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 | } |
no test coverage detected