MCPcopy
hub / github.com/vikiboss/60s / randomItem

Method randomItem

src/common.ts:102–104  ·  view source on GitHub ↗
(arr: T[])

Source from the content-addressed store, hash-verified

100 }
101
102 static randomItem<T>(arr: T[]): T {
103 return arr[Math.floor(Math.random() * arr.length)]
104 }
105
106 static async getParam(name: string, request: Request & { _bodyJson?: Record<string, any> }, parseBody = false) {
107 const value = request.url.searchParams.get(name) ?? ''

Callers 9

#fetchMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected