MCPcopy
hub / github.com/callumalpass/tasknotes / parseVersion

Function parseVersion

generate-release-notes-import.mjs:9–18  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

7
8// Parse semantic version (supports pre-release versions like 4.0.0-beta.0)
9function parseVersion(version) {
10 const match = version.match(/^(\d+)\.(\d+)\.(\d+)(?:-[\w.]+)?$/);
11 if (!match) return null;
12 return {
13 major: parseInt(match[1]),
14 minor: parseInt(match[2]),
15 patch: parseInt(match[3]),
16 full: version
17 };
18}
19
20// Get git tag date for a version
21function getVersionDate(version) {

Calls

no outgoing calls

Tested by

no test coverage detected