Converts the keys of an object to kebab-case and returns a new object. This is particularly useful for registering sub-components in TComponent.uses using object shorthand notation, automatically generating standard HTML tag names.
TComponent.uses
The object whose keys should be converted.
A new object with kebab-cased keys.
class App extends TComponent { static uses = kebabKeys({ DynamicList, UserProfile }); // Results in: { 'dynamic-list': DynamicList, 'user-profile': UserProfile }} Copy
class App extends TComponent { static uses = kebabKeys({ DynamicList, UserProfile }); // Results in: { 'dynamic-list': DynamicList, 'user-profile': UserProfile }}
Converts the keys of an object to kebab-case and returns a new object. This is particularly useful for registering sub-components in
TComponent.usesusing object shorthand notation, automatically generating standard HTML tag names.