MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / parseVersion

Function parseVersion

src/cli/commands/upgrade.ts:68–78  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

66// --- Version comparison ---
67
68export function parseVersion(raw: string): ParsedVersion | undefined {
69 const stripped = raw.startsWith('v') ? raw.slice(1) : raw;
70 const match = stripped.match(/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+[a-zA-Z0-9.-]+)?$/);
71 if (!match) return undefined;
72 return {
73 major: Number(match[1]),
74 minor: Number(match[2]),
75 patch: Number(match[3]),
76 prerelease: match[4],
77 };
78}
79
80function comparePrereleaseIdentifiers(a: string, b: string): number {
81 const aParts = a.split('.');

Callers 2

upgrade.test.tsFile · 0.90
runUpgradeCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected