MCPcopy
hub / github.com/tldraw/tldraw / randomElement

Method randomElement

packages/sync-core/src/test/RandomSource.ts:43–45  ·  view source on GitHub ↗
(items: Elem[])

Source from the content-addressed store, hash-verified

41 }
42
43 randomElement<Elem>(items: Elem[]): Elem | undefined {
44 return items[this.randomInt(items.length)]
45 }
46}

Callers 2

getRandomShapeIdMethod · 0.80
getRandomOpMethod · 0.80

Calls 1

randomIntMethod · 0.95

Tested by

no test coverage detected