(min: number, max: number)
| 35 | }; |
| 36 | |
| 37 | const numberInRange = (min: number, max: number) => (value: string) => { |
| 38 | if (Number(value) < min || Number(value) > max) { |
| 39 | throw new InvalidOptionArgumentError( |
| 40 | `Value is out of range (${min}-${max})` |
| 41 | ); |
| 42 | } |
| 43 | return parseInt(value); |
| 44 | }; |
| 45 | |
| 46 | const parseIntWithValidation = (value: string) => { |
| 47 | const i = parseInt(value); |