mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Improve regex in utils.parseVersion
This commit is contained in:
parent
86e1ccdd8d
commit
912f27c42c
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1121,7 +1121,7 @@ exports.fetch = fetch;
|
||||
async function parseVersion(version) {
|
||||
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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user