MCPcopy
hub / github.com/less/less.js / nextAlphaVersion

Function nextAlphaVersion

scripts/test-release-automation.js:154–162  ·  view source on GitHub ↗

* Alpha version increment — mirrors the inline Node script in * create-release-pr.yml "Determine next version" step for the alpha branch. * * X.Y.Z-alpha.N → X.Y.Z-alpha.(N+1) * X.Y.Z → (X+1).0.0-alpha.1 (no alpha suffix yet)

(current)

Source from the content-addressed store, hash-verified

152 * X.Y.Z → (X+1).0.0-alpha.1 (no alpha suffix yet)
153 */
154function nextAlphaVersion(current) {
155 const m = current.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/);
156 if (m) {
157 return `${m[1]}-alpha.${parseInt(m[2], 10) + 1}`;
158 }
159 const parts = current.replace(/-.*/, '').split('.');
160 const nextMajor = parseInt(parts[0], 10) + 1;
161 return `${nextMajor}.0.0-alpha.1`;
162}
163
164// ---------------------------------------------------------------------------
165// Helpers: temporary git repo

Callers 1

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected