Fixed missing word definition breaking Clive. Using em space in wordle letterboard for SChat.

This commit is contained in:
ThePendulum 2024-06-09 18:26:17 +02:00
parent 3196877c37
commit bbe573d8f3
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ async function init() {
const sortedWords = validWords.reduce((acc, [rawWord, fullDefinition]) => { const sortedWords = validWords.reduce((acc, [rawWord, fullDefinition]) => {
const word = rawWord.toLowerCase(); const word = rawWord.toLowerCase();
const anagram = word.split('').sort().join(''); 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]) { if (!acc[anagram.length]) {
acc[anagram.length] = {}; acc[anagram.length] = {};

View File

@ -58,7 +58,7 @@ function getBoard(letters, showLetters, context) {
return config.platform === 'irc' return config.platform === 'irc'
? letter ? letter
: style.grey(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 return `${prefix}${middle}${suffix}Letters: ${letterBoard}`; // eslint-disable-line no-irregular-whitespace
} }