mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
refactor: turn random word list source from json to ts
This prevents future import issues Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e5911b09c1
commit
d1ce1cb3e4
3 changed files with 1337 additions and 1332 deletions
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import lists from './random-words.json';
|
import { adjectives, items } from './random-words';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a random names based on an adjective and a noun.
|
* Generates a random names based on an adjective and a noun.
|
||||||
|
@ -11,8 +11,8 @@ import lists from './random-words.json';
|
||||||
* @return the generated name
|
* @return the generated name
|
||||||
*/
|
*/
|
||||||
export function generateRandomName(): string {
|
export function generateRandomName(): string {
|
||||||
const adjective = generateRandomWord(lists.adjectives);
|
const adjective = generateRandomWord(adjectives);
|
||||||
const things = generateRandomWord(lists.items);
|
const things = generateRandomWord(items);
|
||||||
return `${adjective} ${things}`;
|
return `${adjective} ${things}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
1334
backend/src/realtime/realtime-note/random-word-lists/random-words.ts
Normal file
1334
backend/src/realtime/realtime-note/random-word-lists/random-words.ts
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue