(prefix?: string, nodeType?: string)
| 233 | |
| 234 | // Generate semantic class names for Svelte |
| 235 | export function getSvelteClassName(prefix?: string, nodeType?: string): string { |
| 236 | if (!prefix) { |
| 237 | return nodeType?.toLowerCase() || "element"; |
| 238 | } |
| 239 | |
| 240 | // Clean and format the prefix |
| 241 | return prefix |
| 242 | .replace(/[^a-zA-Z0-9_-]/g, "-") |
| 243 | .replace(/-{2,}/g, "-") // Replace multiple hyphens with a single one |
| 244 | .replace(/^-+|-+$/g, "") // Remove leading/trailing hyphens |
| 245 | .toLowerCase(); |
| 246 | } |
| 247 | |
| 248 | // Generate component code based on the specified mode |
| 249 | function generateComponentCode( |
nothing calls this directly
no outgoing calls
no test coverage detected