MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / maybeNull

Function maybeNull

apps/web/src/scripts/usage/benchmark-insert-usage.ts:34–36  ·  view source on GitHub ↗
(value: T, nullPct: number)

Source from the content-addressed store, hash-verified

32}
33
34function maybeNull<T>(value: T, nullPct: number): T | null {
35 return Math.random() * 100 < nullPct ? null : value;
36}
37
38function randomInt(avg: number, min = 0, max = avg * 3): number {
39 return Math.max(min, Math.min(max, Math.round(avg + (Math.random() - 0.5) * (max - min))));

Callers 1

generateRandomRecordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected