MCPcopy Create free account
hub / github.com/denoland/std / generateRandomString

Function generateRandomString

text/_test_util.ts:5–9  ·  view source on GitHub ↗
(min: number, max: number)

Source from the content-addressed store, hash-verified

3import { stubProperty } from "@std/testing/unstable-stub-property";
4
5export function generateRandomString(min: number, max: number): string {
6 return Array.from({ length: Math.floor(Math.random() * (max - min) + min) })
7 .map(() => String.fromCharCode(Math.floor(Math.random() * 26) + 97))
8 .join("");
9}
10
11export function stubIntlFunctions(defaultLocale: string) {
12 const fnNames = ["toLocaleLowerCase", "toLocaleUpperCase"] as const;

Callers 2

fnFunction · 0.90

Calls 2

floorMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected