MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / getFunboxSection

Function getFunboxSection

frontend/src/ts/test/words-generator.ts:325–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323}
324
325async 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
348function getFunboxWord(
349 word: string,

Callers 1

getNextWordFunction · 0.85

Calls 3

toggleFunboxFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected