MCPcopy
hub / github.com/colinhacks/zod / randomString

Function randomString

packages/bench/benchUtil.ts:14–21  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

12}
13
14export function randomString(length: number): string {
15 const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
16 let result = "";
17 for (let i = 0; i < length; i++) {
18 result += characters.charAt(Math.floor(Math.random() * characters.length));
19 }
20 return result;
21}
22
23export function randomPick(options: any[]): any {
24 return options[Math.floor(Math.random() * options.length)];

Callers 8

property-access.tsFile · 0.70
dataFunction · 0.70
lazy-box.tsFile · 0.70
array.tsFile · 0.70
jit-union.tsFile · 0.70
libs.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected