()
| 323 | } |
| 324 | |
| 325 | async function getFunboxSection(): Promise<string[]> { |
| 326 | const ret = []; |
| 327 | |
| 328 | const funbox = findSingleActiveFunboxWithFunction("pullSection"); |
| 329 | |
| 330 | if (funbox) { |
| 331 | const section = await funbox.functions.pullSection(Config.language); |
| 332 | |
| 333 | if (section === false || section === undefined) { |
| 334 | toggleFunbox(funbox.name); |
| 335 | throw new Error("Failed to pull section"); |
| 336 | } |
| 337 | |
| 338 | for (const word of section.words) { |
| 339 | if (ret.length >= Config.words && Config.mode === "words") { |
| 340 | break; |
| 341 | } |
| 342 | ret.push(word); |
| 343 | } |
| 344 | } |
| 345 | return ret; |
| 346 | } |
| 347 | |
| 348 | function getFunboxWord( |
| 349 | word: string, |
no test coverage detected