mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-28 12:43:12 +08:00
[offers][feat] add random name generator
This commit is contained in:
@ -38,6 +38,7 @@
|
||||
"react-popper-tooltip": "^4.4.2",
|
||||
"react-query": "^3.39.2",
|
||||
"superjson": "^1.10.0",
|
||||
"unique-names-generator": "^4.7.1",
|
||||
"zod": "^3.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
13
apps/portal/src/utils/offers/randomNameGenerator.ts
Normal file
13
apps/portal/src/utils/offers/randomNameGenerator.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import type { Config } from 'unique-names-generator';
|
||||
import { adjectives, animals,colors, uniqueNamesGenerator } from 'unique-names-generator';
|
||||
|
||||
const customConfig: Config = {
|
||||
dictionaries: [adjectives, colors, animals],
|
||||
length: 3,
|
||||
separator: '-',
|
||||
};
|
||||
|
||||
|
||||
export default function generateRandomName(): string {
|
||||
return uniqueNamesGenerator(customConfig)
|
||||
}
|
Reference in New Issue
Block a user