mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-27 07:18:17 +01:00
11 lines
197 B
TypeScript
11 lines
197 B
TypeScript
const toKebabCase = (str: string = ""): string =>
|
|
str
|
|
.toLowerCase()
|
|
.replace(/[^\w\s]/gi, "")
|
|
.split(" ")
|
|
.join("-")
|
|
.split("_")
|
|
.join("-");
|
|
|
|
export default toKebabCase;
|