MCPcopy
hub / github.com/jwngr/sdow / getRandomPageTitle

Function getRandomPageTitle

website/src/utils.ts:13–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12let unusedPageTitles: string[] = [];
13export const getRandomPageTitle = (): string => {
14 if (unusedPageTitles.length === 0) {
15 unusedPageTitles = clone(pageTitles);
16 }
17
18 const indexToRemove = Math.floor(Math.random() * unusedPageTitles.length);
19 return unusedPageTitles.splice(indexToRemove, 1)[0];
20};
21
22let unusedWikipediaFacts: string[] = [];
23export const getRandomWikipediaFact = (): string => {

Callers 2

PageInputFunction · 0.90
HomeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected