Keep a two digit minor in parseVersion (#1134)

Co-authored-by: Michael Lip <51033404+theluckystrike@users.noreply.github.com>
This commit is contained in:
Michael Lip
2026-10-10 15:23:58 +05:30
committed by GitHub
parent db75472672
commit c463b1d02f
3 changed files with 7 additions and 7 deletions
+3 -6
View File
@@ -91,12 +91,9 @@ export async function parseVersion(version: string): Promise<string> {
if (!/^\d+(\.\d+){0,2}$/.test(version)) {
throw new Error(`Invalid PHP version: ${version.slice(0, 20)}`);
}
switch (true) {
case version.length > 1:
return version.slice(0, 3);
default:
return version + '.0';
}
return version.includes('.')
? version.split('.').slice(0, 2).join('.')
: version + '.0';
}
}