This commit is contained in:
Benjamin Toby
2025-04-23 13:20:44 +01:00
parent 6593047efd
commit cd6bfdfc67
8 changed files with 11 additions and 7 deletions
+3 -1
View File
@@ -8,8 +8,10 @@
* slugify("Yes!") // "yes"
* slugify("Hello!!! World!") // "hello-world"
*/
export default function slugify(str: string): string {
export default function slugify(str?: string): string {
try {
if (!str) return "";
return String(str)
.trim()
.toLowerCase()