mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-27 21:55:11 +07:00 
			
		
		
		
	Improve regex in utils.parseVersion
This commit is contained in:
		
							
								
								
									
										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) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shivam Mathur
					Shivam Mathur