Skip to content

Commit

Permalink
fix: trailing spaces giphy (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
TacticalTechJay authored Aug 29, 2023
1 parent 86c3e78 commit 72e24a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/adjectives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1498,4 +1498,4 @@ wheat
white
whitesmoke
yellow
yellowgreen
yellowgreen
2 changes: 1 addition & 1 deletion public/animals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1747,4 +1747,4 @@ zigzagsalamander
zonetailedpigeon
zooplankton
zopilote
zorilla
zorilla
6 changes: 3 additions & 3 deletions src/lib/format/gfycat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export type GfyCatWords = {
};

export async function importWords(): Promise<GfyCatWords> {
const adjectives = (await readFile('public/adjectives.txt', 'utf-8')).split('\n');
const animals = (await readFile('public/animals.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').map((x) => x.trim());

return {
adjectives,
Expand All @@ -22,5 +22,5 @@ function randomWord(words: string[]) {
export default async function gfycat() {
const words = await importWords();

return `${randomWord(words.adjectives)}${randomWord(words.adjectives)}${randomWord(words.animals)}`;
return `${randomWord(words.adjectives)} ${randomWord(words.adjectives)} ${randomWord(words.animals)}`;
}

0 comments on commit 72e24a8

Please sign in to comment.