| 8 | * @returns {Object|null} The modified rule with properly formatted class names, or null if the rule is invalid. |
| 9 | */ |
| 10 | export const indentClassNames = rule => { |
| 11 | // Ensure that the rule contains necessary properties |
| 12 | if (!rule || !rule.params || !rule.raws || !rule.raws.before) { |
| 13 | return null; |
| 14 | } |
| 15 | |
| 16 | const indent = ' '.repeat(rule.raws.before.length + 1); |
| 17 | |
| 18 | // Clean and split the class names |
| 19 | const cleanedClasses = cleanClassNames(rule.params); |
| 20 | |
| 21 | // Apply the indentation and join the class names back together |
| 22 | rule.params = applyIndentation(cleanedClasses, indent); |
| 23 | |
| 24 | return rule; |
| 25 | }; |
| 26 | |
| 27 | /** |
| 28 | * Cleans the input string by removing unnecessary whitespace and newlines. |
no test coverage detected