(version: string)
| 17 | } |
| 18 | |
| 19 | function parseComparableCurrentVersion(version: string): ParsedComparableVersion | null { |
| 20 | const normalized = version.trim().replace(/^v/i, '') |
| 21 | const match = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?$/.exec(normalized) |
| 22 | if (!match) return null |
| 23 | |
| 24 | return { |
| 25 | ...buildParsedVersion(match), |
| 26 | prerelease: Boolean(match[4]), |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | function buildParsedVersion(match: RegExpExecArray): ParsedStableVersion { |
| 31 | return { |
no test coverage detected