mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
16 lines
568 B
TypeScript
16 lines
568 B
TypeScript
import { faker } from "@faker-js/faker";
|
|
import { customAlphabet } from "nanoid";
|
|
|
|
const alphabet = "abcdefghijklmnopqrstuvwxyz123456789";
|
|
|
|
const customNanoid = customAlphabet(alphabet, 6);
|
|
|
|
export const generateAppName = (type: string) => {
|
|
const verb = faker.hacker.verb().replace(/ /g, "-");
|
|
const adjective = faker.hacker.adjective().replace(/ /g, "-");
|
|
const noun = faker.hacker.noun().replace(/ /g, "-");
|
|
const randomFakerElement = `${verb}-${adjective}-${noun}`;
|
|
const nanoidPart = customNanoid();
|
|
return `${type}-${randomFakerElement}-${nanoidPart}`;
|
|
};
|