Use niceId

This commit is contained in:
Owen Schwartz 2024-10-14 22:26:32 -04:00
parent ff47ba0b77
commit c47d7fb1ff
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
15 changed files with 62 additions and 55 deletions

View file

@ -12,7 +12,7 @@ export const names = JSON.parse(readFileSync(file, 'utf-8'));
export function getUniqueName(): string {
return (
names.animals[Math.floor(Math.random() * names.animals.length)] +
names.descriptor[Math.floor(Math.random() * names.descriptor.length)]
).toLowerCase();
names.descriptors[Math.floor(Math.random() * names.descriptors.length)] + "-" +
names.animals[Math.floor(Math.random() * names.animals.length)]
).toLowerCase().replace(/\s/g, '-');
}