MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / parseVersion

Function parseVersion

packages/shared/src/versionUtils.ts:9–19  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

7};
8
9export 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
21export const formatVersion = (version: Version): string => {
22 return `v${version.major}.${version.minor}.${version.patch}`;

Callers 3

getUpgradeAvailabilityFunction · 0.85
tryGetLatestSourcebotTagFunction · 0.85
ChangelogEntryDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected