(v: string)
| 59 | } |
| 60 | |
| 61 | function splitVersion(v: string): [number[], string] { |
| 62 | const [main, pre = ""] = v.split("-", 2); |
| 63 | const parts = main.split(".").map((p) => { |
| 64 | const n = Number.parseInt(p, 10); |
| 65 | return Number.isFinite(n) ? n : 0; |
| 66 | }); |
| 67 | while (parts.length < 3) parts.push(0); |
| 68 | return [parts, pre]; |
| 69 | } |
| 70 | |
| 71 | interface CachedCheck { |
| 72 | checkedAt: number; |