honigle/src/lib/words.ts
2022-01-29 22:06:54 +00:00

24 lines
548 B
TypeScript

import { WORDS } from '../constants/wordlist'
import { VALIDGUESSES } from '../constants/validGuesses'
export const isWordInWordList = (word: string) => {
return (
WORDS.includes(word.toLowerCase()) ||
VALIDGUESSES.includes(word.toLowerCase())
)
}
export const isWinningWord = (word: string) => {
return solution === word
}
export const getWordOfDay = () => {
// January 1, 2022 Game Epoch
return {
solution: WORDS[0].toUpperCase(),
solutionIndex: 0,
}
}
export const { solution, solutionIndex } = getWordOfDay()