6 lines
151 B
TypeScript
6 lines
151 B
TypeScript
export const toKebabCase = (string: string): string =>
|
|
string
|
|
?.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
.replace(/\s+/g, '-')
|
|
.toLowerCase()
|