mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -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
|
||||
*/
|
||||
import lists from './random-words.json';
|
||||
import { adjectives, items } from './random-words';
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
export function generateRandomName(): string {
|
||||
const adjective = generateRandomWord(lists.adjectives);
|
||||
const things = generateRandomWord(lists.items);
|
||||
const adjective = generateRandomWord(adjectives);
|
||||
const things = generateRandomWord(items);
|
||||
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