(rawValue, fallback)
| 48 | } |
| 49 | |
| 50 | function parseNonNegativeInt(rawValue, fallback) { |
| 51 | if (rawValue == null || rawValue === '') { |
| 52 | return fallback |
| 53 | } |
| 54 | |
| 55 | const parsed = Number.parseInt(rawValue, 10) |
| 56 | if (!Number.isInteger(parsed) || parsed < 0) { |
| 57 | return undefined |
| 58 | } |
| 59 | |
| 60 | return parsed |
| 61 | } |
| 62 | |
| 63 | function resetState() { |
| 64 | projects = createSeedProjects() |