(styles: string[], isJSX: boolean)
| 78 | |
| 79 | // Convert styles to CSS format |
| 80 | export function stylesToCSS(styles: string[], isJSX: boolean): string[] { |
| 81 | return styles |
| 82 | .map((style) => { |
| 83 | // Skip empty styles |
| 84 | if (!style.trim()) return ""; |
| 85 | |
| 86 | // Handle JSX format if needed |
| 87 | if (isJSX) { |
| 88 | return style.replace(/^([a-zA-Z0-9]+):/, (match, prop) => { |
| 89 | // Convert camelCase to kebab-case for CSS |
| 90 | return ( |
| 91 | prop |
| 92 | .replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2") |
| 93 | .toLowerCase() + ":" |
| 94 | ); |
| 95 | }); |
| 96 | } |
| 97 | return style; |
| 98 | }) |
| 99 | .filter(Boolean); // Remove empty entries |
| 100 | } |
| 101 | |
| 102 | // Get proper component name from node info |
| 103 | export function getComponentName( |
no outgoing calls
no test coverage detected