mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-02 03:37:16 +07:00
Improve regex in utils.parseVersion
This commit is contained in:
@ -69,7 +69,7 @@ export async function fetch(url: string): Promise<string> {
|
||||
export async function parseVersion(version: string): Promise<string> {
|
||||
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
||||
switch (true) {
|
||||
case /latest|\d.x/.test(version):
|
||||
case /^(latest|\d+\.x)$/.test(version):
|
||||
return JSON.parse(await fetch(manifest))[version];
|
||||
default:
|
||||
switch (true) {
|
||||
|
Reference in New Issue
Block a user