(version: string)
| 7 | }; |
| 8 | |
| 9 | export const parseVersion = (version: string): Version | null => { |
| 10 | const match = version.match(SEMVER_REGEX); |
| 11 | if (!match) { |
| 12 | return null; |
| 13 | } |
| 14 | return { |
| 15 | major: parseInt(match[1]), |
| 16 | minor: parseInt(match[2]), |
| 17 | patch: parseInt(match[3]), |
| 18 | }; |
| 19 | }; |
| 20 | |
| 21 | export const formatVersion = (version: Version): string => { |
| 22 | return `v${version.major}.${version.minor}.${version.patch}`; |
no outgoing calls
no test coverage detected