mirror of
https://github.com/diced/zipline.git
synced 2025-05-11 10:26:05 +02:00
fix: trailing spaces giphy (#449)
This commit is contained in:
parent
86c3e780d1
commit
72e24a8b86
3 changed files with 5 additions and 5 deletions
|
@ -1498,4 +1498,4 @@ wheat
|
||||||
white
|
white
|
||||||
whitesmoke
|
whitesmoke
|
||||||
yellow
|
yellow
|
||||||
yellowgreen
|
yellowgreen
|
|
@ -1747,4 +1747,4 @@ zigzagsalamander
|
||||||
zonetailedpigeon
|
zonetailedpigeon
|
||||||
zooplankton
|
zooplankton
|
||||||
zopilote
|
zopilote
|
||||||
zorilla
|
zorilla
|
|
@ -6,8 +6,8 @@ export type GfyCatWords = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function importWords(): Promise<GfyCatWords> {
|
export async function importWords(): Promise<GfyCatWords> {
|
||||||
const adjectives = (await readFile('public/adjectives.txt', 'utf-8')).split('\n');
|
const adjectives = (await readFile('public/adjectives.txt', 'utf-8')).split('\n').map((x) => x.trim());
|
||||||
const animals = (await readFile('public/animals.txt', 'utf-8')).split('\n');
|
const animals = (await readFile('public/animals.txt', 'utf-8')).split('\n').map((x) => x.trim());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
adjectives,
|
adjectives,
|
||||||
|
@ -22,5 +22,5 @@ function randomWord(words: string[]) {
|
||||||
export default async function gfycat() {
|
export default async function gfycat() {
|
||||||
const words = await importWords();
|
const words = await importWords();
|
||||||
|
|
||||||
return `${randomWord(words.adjectives)}${randomWord(words.adjectives)}${randomWord(words.animals)}`;
|
return `${randomWord(words.adjectives)} ${randomWord(words.adjectives)} ${randomWord(words.animals)}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue