mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-31 07:47:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			360 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			360 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const urlVariableRegex = /\{[^}]+\}/g;
 | |
| function removeNonChars(variableName) {
 | |
|     return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
 | |
| }
 | |
| export function extractUrlVariableNames(url) {
 | |
|     const matches = url.match(urlVariableRegex);
 | |
|     if (!matches) {
 | |
|         return [];
 | |
|     }
 | |
|     return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
 | |
| }
 | 
