From bbe573d8f3f338d506bd06af0d9ebb28c0d03429 Mon Sep 17 00:00:00 2001 From: ThePendulum Date: Sun, 9 Jun 2024 18:26:17 +0200 Subject: [PATCH] Fixed missing word definition breaking Clive. Using em space in wordle letterboard for SChat. --- assets/dictionary-to-mash.js | 2 +- src/games/wordle.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/dictionary-to-mash.js b/assets/dictionary-to-mash.js index 64c769c..26ca86f 100755 --- a/assets/dictionary-to-mash.js +++ b/assets/dictionary-to-mash.js @@ -34,7 +34,7 @@ async function init() { const sortedWords = validWords.reduce((acc, [rawWord, fullDefinition]) => { const word = rawWord.toLowerCase(); const anagram = word.split('').sort().join(''); - const definitions = fullDefinition?.split(/\d+\.\s+/).filter(Boolean).map((definition) => definition.split('.')[0].toLowerCase()); + const definitions = fullDefinition?.split(/\d+\.\s+/).filter(Boolean).map((definition) => definition.split('.')[0].toLowerCase()) || []; if (!acc[anagram.length]) { acc[anagram.length] = {}; diff --git a/src/games/wordle.js b/src/games/wordle.js index d8a882a..5a5f586 100644 --- a/src/games/wordle.js +++ b/src/games/wordle.js @@ -58,7 +58,7 @@ function getBoard(letters, showLetters, context) { return config.platform === 'irc' ? letter : style.grey(letter); - }).join(' '); + }).join(config.platform === 'irc' ? ' ' : ' '); // regular space vs em space return `${prefix}${middle}${suffix} Letters: ${letterBoard}`; // eslint-disable-line no-irregular-whitespace }