Converts a PascalCase, camelCase, or snake_case string to kebab-case.
Parameters
str: string
The string to convert.
Returns string
The kebab-case string.
Remarks
This function is useful for converting JavaScript property names to CSS or HTML attribute names.
It strictly validates the input to contain only alphanumeric characters and underscores.
Converts a PascalCase, camelCase, or snake_case string to kebab-case.