Parse a semver-ish string's major number; returns NaN for pre-releases etc.
(version: string)
| 47 | |
| 48 | /** Parse a semver-ish string's major number; returns NaN for pre-releases etc. */ |
| 49 | function majorOf(version: string): number { |
| 50 | const match = /^(\d+)\./.exec(version); |
| 51 | return match?.[1] ? Number.parseInt(match[1], 10) : Number.NaN; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Quietly log a diagnostic line to `auto-update.log`. Never throws — a bad |
no outgoing calls
no test coverage detected