(value: T, nullPct: number)
| 32 | } |
| 33 | |
| 34 | function maybeNull<T>(value: T, nullPct: number): T | null { |
| 35 | return Math.random() * 100 < nullPct ? null : value; |
| 36 | } |
| 37 | |
| 38 | function 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)))); |
no outgoing calls
no test coverage detected