diff --git a/src/scripts/make-word-list.ts b/src/scripts/make-word-list.ts index 35ce1e0..a3e4bc0 100644 --- a/src/scripts/make-word-list.ts +++ b/src/scripts/make-word-list.ts @@ -2,8 +2,6 @@ import fs from "fs"; -import { isSuperset } from "../lib/utils"; - const WORD_LIST_FP: string = "./src/assets/words/word-list.json"; const GAME_LIST_FP: string = "./src/assets/words/game-list.json"; @@ -14,6 +12,15 @@ const MAX_WORD_SIZE: number = 5; const RAW_WORDS_URL: string = "https://raw.githubusercontent.com/wordnik/wordlist/main/wordlist-20210729.txt"; +export function isSuperset(set: Set, subset: Iterable): boolean { + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; +} + function isWordValid(word: string): boolean { if (word.length < MIN_LETTERS || word.length > MAX_LETTERS) { return false; diff --git a/tsconfig.app.json b/tsconfig.app.json index 85ee9e2..62eeafa 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -1,6 +1,6 @@ { "extends": "@vue/tsconfig/tsconfig.dom.json", - "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/lib/*"], + "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/lib/**/*"], "exclude": ["src/**/__tests__/*", "src/scripts"], "compilerOptions": { "composite": true,