(min: number, max?: number)
| 394 | if (total > 0) { |
| 395 | const totalShots = Object.entries(dist).reduce((s_0, [count, sessions]) => s_0 + parseInt(count, 10) * sessions, 0); |
| 396 | const bucket = (min: number, max?: number) => Object.entries(dist).filter(([k]) => { |
| 397 | const n_0 = parseInt(k, 10); |
| 398 | return n_0 >= min && (max === undefined || n_0 <= max); |
| 399 | }).reduce((s_1, [, v]) => s_1 + v, 0); |
| 400 | const pct = (n_1: number) => Math.round(n_1 / total * 100); |
| 401 | const b1 = bucket(1, 1); |
| 402 | const b2_5 = bucket(2, 5); |
no test coverage detected