(num: number, min: number, max: number)
| 60 | } |
| 61 | |
| 62 | function boundNumber(num: number, min: number, max: number): number { |
| 63 | if (num == null || typeof num != "number" || isNaN(num)) { |
| 64 | return null; |
| 65 | } |
| 66 | return Math.min(Math.max(num, min), max); |
| 67 | } |
| 68 | |
| 69 | // key must be a suitable weakmap key. pass the new value |
| 70 | // it will return the prevValue (for object equality) if the new value is deep equal to the prev value |
no outgoing calls
no test coverage detected