mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-30 16:54:11 +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;
|