(min: number, max?: number)
| 301 | if (total > 0) { |
| 302 | const totalShots = Object.entries(dist).reduce((s, [count, sessions]) => s + parseInt(count, 10) * sessions, 0); |
| 303 | const bucket = (min: number, max?: number) => |
| 304 | Object.entries(dist) |
| 305 | .filter(([k]) => { |
| 306 | const n = parseInt(k, 10); |
| 307 | return n >= min && (max === undefined || n <= max); |
| 308 | }) |
| 309 | .reduce((s, [, v]) => s + v, 0); |
| 310 | const pct = (n: number) => Math.round((n / total) * 100); |
| 311 | const b1 = bucket(1, 1); |
| 312 | const b2_5 = bucket(2, 5); |
no test coverage detected