mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
16 lines
262 B
TypeScript
16 lines
262 B
TypeScript
import slug from "slugify";
|
|
|
|
export const slugify = (text: string | undefined) => {
|
|
if (!text) {
|
|
return "";
|
|
}
|
|
|
|
const cleanedText = text.trim().replace(/[^a-zA-Z0-9\s]/g, "");
|
|
|
|
return slug(cleanedText, {
|
|
lower: true,
|
|
trim: true,
|
|
strict: true,
|
|
});
|
|
};
|