-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: turn up the heat in the agent/workflow name generation (#679)
- Loading branch information
1 parent
e4c4807
commit 9b47349
Showing
1 changed file
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { faker } from "@faker-js/faker"; | ||
|
||
export function generateRandomName(): string { | ||
// faker doesn't have a "capitalized word" function, so we need to do it manually :( | ||
const rawAdjective = faker.word.adjective(); | ||
const rawAnimal = faker.animal.type(); | ||
const adjective = | ||
rawAdjective.charAt(0).toUpperCase() + rawAdjective.slice(1); | ||
const animal = rawAnimal.charAt(0).toUpperCase() + rawAnimal.slice(1); | ||
const uppercaseFirst = (word: string) => | ||
word.charAt(0).toUpperCase() + word.slice(1); | ||
|
||
return `${adjective} ${animal}`; | ||
export function generateRandomName(): string { | ||
return [faker.word.adjective(), faker.word.noun()] | ||
.map(uppercaseFirst) | ||
.join(" "); | ||
} |