mirror of
https://github.com/Dokploy/cli.git
synced 2026-06-15 20:25:22 +02:00
15 lines
268 B
TypeScript
15 lines
268 B
TypeScript
import slug from "./slugify.js";
|
|
|
|
export const slugify = (text: string | undefined) => {
|
|
if (!text) {
|
|
return "";
|
|
}
|
|
|
|
const cleanedText = text.trim().replaceAll(/[^\d\sA-Za-z]/g, "");
|
|
return slug(cleanedText, {
|
|
lower: true,
|
|
strict: true,
|
|
trim: true,
|
|
});
|
|
};
|