Clamps a value to be between two numbers, by default 0 and 100.
(v: number, min = 0, max = 100)
| 252 | |
| 253 | /** Clamps a value to be between two numbers, by default 0 and 100. */ |
| 254 | function clamp(v: number, min = 0, max = 100) { |
| 255 | return Math.max(min, Math.min(max, v)); |
| 256 | } |
no test coverage detected