UNPKG
@lucide/helpers
Version:
latest (1.0.0)
1.0.0
A internal used package with helpers.
@lucide/helpers
/
src
/
toKebabCase.mjs
8 lines
(7 loc)
•
209 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
/** * Converts string to KebabCase * *
@param
{
string
}
string
*
@returns
{
string
} A kebabized string */
export
const
toKebabCase
= (
string
) =>
string
.
replace
(
/([a-z0-9])([A-Z])/g
,
'$1-$2'
).
toLowerCase
();