mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-28 15:58:33 +01:00
7 lines
174 B
TypeScript
7 lines
174 B
TypeScript
|
const toKebabCase = (str: string = ""): string => str.toLowerCase()
|
||
|
.replace(/[^\w\s]/gi, "")
|
||
|
.split(" ").join("-")
|
||
|
.split("_").join("-");
|
||
|
|
||
|
export default toKebabCase;
|