MCPcopy
hub / github.com/benjitaylor/agentation / normalizeComponentName

Function normalizeComponentName

package/src/utils/react-detection.ts:241–246  ·  view source on GitHub ↗

* Normalize a component name to match CSS class conventions * SideNav -> side-nav, LinkComponent -> link-component

(name: string)

Source from the content-addressed store, hash-verified

239 * SideNav -> side-nav, LinkComponent -> link-component
240 */
241function 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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…