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)
|
||||
}
|
@ -14405,6 +14405,11 @@ unique-filename@^1.1.1:
|
||||
dependencies:
|
||||
unique-slug "^2.0.0"
|
||||
|
||||
unique-names-generator@^4.7.1:
|
||||
version "4.7.1"
|
||||
resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597"
|
||||
integrity sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==
|
||||
|
||||
unique-slug@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"
|
||||
|
Reference in New Issue
Block a user