* Normalize a component name to match CSS class conventions * SideNav -> side-nav, LinkComponent -> link-component
(name: string)
| 239 | * SideNav -> side-nav, LinkComponent -> link-component |
| 240 | */ |
| 241 | function normalizeComponentName(name: string): string { |
| 242 | return name |
| 243 | .replace(/([a-z])([A-Z])/g, "$1-$2") |
| 244 | .replace(/([A-Z])([A-Z][a-z])/g, "$1-$2") |
| 245 | .toLowerCase(); |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Collect CSS classes from an element and its ancestors |
no outgoing calls
no test coverage detected
searching dependent graphs…