Function
requireNonNegativeInteger
(name: string, value: string | undefined)
Source from the content-addressed store, hash-verified
| 367 | } |
| 368 | |
| 369 | function requireNonNegativeInteger(name: string, value: string | undefined) { |
| 370 | const parsed = Number(value) |
| 371 | if (!Number.isInteger(parsed) || parsed < 0) throw new Error(`${name} must be a non-negative integer`) |
| 372 | return parsed |
| 373 | } |
| 374 | |
| 375 | function subtractMonths(date: Date, months: number) { |
| 376 | const result = new Date(date) |
Tested by
no test coverage detected