Converts a kebab-case string to PascalCase.
The string to convert.
The PascalCase string.
This function splits the string by hyphens and capitalizes the first letter of each segment. It handles multiple hyphens by ignoring empty segments.
keb2pas('background-color') // 'BackgroundColor'keb2pas('my-component') // 'MyComponent'keb2pas('multi--dash') // 'MultiDash' Copy
keb2pas('background-color') // 'BackgroundColor'keb2pas('my-component') // 'MyComponent'keb2pas('multi--dash') // 'MultiDash'
If str is not a string.
str
Converts a kebab-case string to PascalCase.