MCPcopy Create free account
hub / github.com/esmBot/esmBot / random

Function random

src/utils/misc.ts:60–62  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

58
59// random(array) to select a random entry in array
60export function random<T>(array: T[]) {
61 return array[Math.floor(Math.random() * array.length)];
62}
63
64const optionalReplace = (token: string) => {
65 return token === undefined || token === "" ? "" : token === "true" || token === "false" ? token : "<redacted>";

Callers 11

getIdealFunction · 0.90
verifyMethod · 0.90
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
paramsFuncMethod · 0.85
paramsFuncMethod · 0.85
activityChangerFunction · 0.85
processMessageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected